/* 思源柔黑 Resource Han Rounded (OFL): one family per weight so any requested weight maps to it. */
@font-face { font-family: "RHR Heavy"; src: url("fonts/rhr-heavy.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "RHR Bold"; src: url("fonts/rhr-bold.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
/* rhr-ext:start — written by tools/build_fonts.sh: characters only the junior books use */
@font-face { font-family: "RHR Heavy"; src: url("fonts/rhr-heavy-x.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+4E01, U+4E08, U+4E10, U+4E11, U+4E13, U+4E22, U+4E27, U+4E38, U+4E39, U+4E3E, U+4E49, U+4E4E, U+4E4F, U+4E54, U+4E58, U+4E5E, U+4E71, U+4E89, U+4E8F, U+4EA1, U+4EA7, U+4ECB, U+4ED4, U+4EE3, U+4EEA, U+4EF0, U+4F01, U+4F0A, U+4F10, U+4F18, U+4F20, U+4F2F, U+4F34, U+4F38, U+4F3C, U+4F3D, U+4F46, U+4F4E, U+4F69, U+4F9B, U+4F9D, U+4FA3, U+4FA6, U+4FC3, U+4FC4, U+4FCA, U+4FD7, U+4FEF, U+4FF1, U+500D, U+5026, U+503E, U+5077, U+507F, U+50B2, U+5141, U+5151, U+51B3, U+51BB, U+51CC, U+51EF, U+520A, U+5218, U+521B, U+523B, U+526A, U+529D, U+52BF, U+52C3, U+52C7, U+52CB, U+52D2, U+5306, U+5319, U+5320, U+534F, U+5362, U+5373, U+5377, U+538B, U+538C, U+539A, U+53CA, U+53CC, U+53D7, U+53E0, U+53E3, U+53E4, U+53E5, U+53EB, U+5404, U+5409, U+5410, U+541B, U+541D, U+5420, U+5426, U+5428, U+5439, U+543B, U+5496, U+5499, U+54AC, U+54C7, U+54C8, U+5510, U+554A, U+5561, U+556C, U+5578, U+5589, U+559D, U+55B1, U+55EF, U+5618, U+5632, U+56E2, U+56F0, U+5708, U+5747, U+574A, U+5757, U+575B, U+5761, U+5766, U+57DF, U+57F9, U+582A, U+5851, U+585E, U+58A8, U+58A9, U+592B, U+592E, U+5947, U+5965, U+59AE, U+59BB, U+59C6, U+5A05, U+5A36, U+5A5A, U+5A92, U+5ACC, U+5AE9, U+5B59, U+5B64, U+5B98, U+5B9A, U+5B9D, U+5BBD, U+5BD3, U+5BFB, U+5C01, U+5C04, U+5C0A, U+5C16, U+5C18, U+5C1A, U+5C24, U+5C2C, U+5C34, U+5C3D, U+5C42, U+5C49, U+5C5E, U+5C96, U+5CA9, U+5CB8, U+5CF0, U+5D16, U+5DE2, U+5DE7, U+5E01, U+5E10, U+5E16, U+5E1D, U+5E2D, U+5E7B, U+5E7C, U+5E7D, U+5E7F, U+5E87, U+5E93, U+5E9C, U+5E9F, U+5EA7, U+5EC9, U+5ECA, U+5EF7, U+5F02, U+5F03, U+5F04, U+5F15, U+5F17, U+5F62, U+5F7B, U+5F7C, U+5F80, U+5F81, U+5F8B, U+5FB7, U+5FC6, U+5FE7, U+5FF5, U+6000, U+6001, U+6012, U+6025, U+602A, U+6050, U+6069, U+6070, U+6076, U+60A3, U+60A6, U+60A8, U+60AC, U+60B2, U+60D1, U+60DC, U+60E7, U+60E9, U+60F0, U+6108, U+6109, U+611A, U+6124, U+6148, U+614C, U+6167, U+618B, U+61BE, U+61D2, U+621A, U+624E, U+6251, U+6254, U+6258, U+6263, U+6267, U+6269, U+6298, U+629B, U+62B1, U+62BD, U+62CD, U+62D2, U+62D3, U+62DB, U+62DF, U+62E5, U+62EC, U+62EF, U+62F3, U+6302, U+6328, U+634E, U+6350, U+635F, U+6361, U+6363, U+6388, U+6392, U+63A7, U+63AA, U+63C9, U+63CF, U+63ED, U+63F4, U+641C, U+642D, U+6444, U+6467, U+6469, U+6491, U+6492, U+649E, U+64AD, U+64C5, U+653B, U+653F, U+654C, U+654F, U+6551, U+6562, U+656C, U+6572, U+65AF, U+65BD, U+65D7, U+65E2, U+65E7, U+65F1, U+6606, U+660F, U+6652, U+666E, U+667A, U+6697, U+66B4, U+66FC, U+671D, U+6728, U+6731, U+6734, U+6740, U+6749, U+674E, U+674F, U+6750, U+6770, U+6781, U+6784, U+679D, U+67AA, U+67D4, U+67DC, U+67F4, U+6842, U+6851, U+6863, U+6885, U+68A6, U+68A8, U+68AF, U+68CD, U+6912, U+695A, U+697C, U+6982, U+6B27, U+6B49, U+6B62, U+6B64, U+6B7B, U+6BC1, U+6BD2, U+6BD5, U+6BEB, U+6C38, U+6C47, U+6C5F, U+6C60, U+6C9B, U+6C9F, U+6CAB, U+6CAE, U+6CB8, U+6CBB, U+6CDB, U+6CE2, U+6CE5, U+6CEA, U+6D1B, U+6D1E, U+6D32, U+6D3D, U+6D4E, U+6D52, U+6D53, U+6D6E, U+6DB2, U+6DC6, U+6DD8, U+6DE1, U+6DF1, U+6DF7, U+6DF9, U+6DFB, U+6E10, U+6E14, U+6E34, U+6EDA, U+6EE4, U+6F02, U+6F06, U+6F2B, U+6F58, U+6F5C, U+6F6E, U+6FA1, U+6FC0, U+704C, U+706D, U+7075, U+7076, U+7089, U+7092, U+70B8, U+70C8, U+70D8, U+70D9, U+70E4, U+70E6, U+70F9, U+7119, U+7126, U+7130, U+714E, U+716E, U+71C3, U+7235, U+7261, U+72AF, U+72B6, U+72C2, U+72C4, U+72E9, U+72EC, U+72ED, U+72FC, U+730E, U+731C, U+732E, U+7389, U+738B, U+73AB, U+73C0, U+73CD, U+7433, U+743C, U+745A, U+745C, U+745F, U+7470, U+751C, U+7545, U+7565, U+7591, U+7597, U+75AF, U+75B2, U+75BE, U+75C7, U+7600, U+764C, U+76CA, U+76D0, U+76D6, U+76DB, U+76F8, U+76FC, U+7701, U+77A7, U+780D, U+7814, U+7834, U+786C, U+788E, U+78B0, U+78C1, U+78E8, U+7901, U+7965, U+798F, U+79BB, U+79C0, U+79C1, U+79E9, U+7A0D, U+7A46, U+7A76, U+7A77, U+7A81, U+7A84, U+7A8D, U+7A9F, U+7ACB, U+7ADE, U+7ADF, U+7AE5, U+7B1B, U+7B3C, U+7B56, U+7B80, U+7B97, U+7BC7, U+7C97, U+7CA5, U+7CB9, U+7CFB, U+7D20, U+7EA4, U+7EAA, U+7EB2, U+7EB3, U+7EBD, U+7EC4, U+7EC6, U+7EC7, U+7ECD, U+7ED5, U+7EDD, U+7EDF, U+7EEA, U+7EF4, U+7EF8, U+7F38, U+7F3A, U+7F55, U+7F5A, U+7F69, U+7F9E, U+7FA4, U+7FBD, U+7FC5, U+7FD4, U+7FF0, U+7FFB, U+8000, U+800C, U+8010, U+8015, U+804B, U+8083, U+8098, U+809A, U+80A4, U+80A5, U+80A9, U+80AA, U+80AF, U+80C3, U+80CE, U+80DE, U+8102, U+8116, U+8131, U+813E, U+814A, U+8150, U+8170, U+8180, U+819D, U+8212, U+8247, U+8273, U+827E, U+828D, U+82AC, U+82BD, U+82D4, U+82D7, U+82DB, U+82E6, U+831C, U+8363, U+836F, U+838E, U+83AB, U+83C7, U+83CC, U+8425, U+8428, U+846C, U+8471, U+8482, U+8499, U+84B8, U+8537, U+853D, U+8587, U+85AA, U+85AF, U+85D3, U+85E4, U+8611, U+8651, U+865A, U+867D, U+8681, U+8682, U+86C7, U+878D, U+8822, U+8840, U+8861, U+88AB, U+88C2, U+8986, U+8A79, U+8BAD, U+8BAF, U+8BB6, U+8BBF, U+8BC0, U+8BC1, U+8BC4, U+8BCA, U+8BD7, U+8BDA, U+8BFA, U+8C05, U+8C0E, U+8C10, U+8C1A, U+8C22, U+8C31, U+8C37, U+8C4C, U+8C5A, U+8C6A, U+8C79, U+8C8C, U+8D1D, U+8D21, U+8D22, U+8D23, U+8D26, U+8D28, U+8D2B, U+8D2D, U+8D3A, U+8D3E, U+8D4B, U+8D4F, U+8D56, U+8D5A, U+8D5E, U+8D60, U+8D64, U+8D6B, U+8D76, U+8DC3, U+8DDD, U+8DDF, U+8DF5, U+8E0F, U+8E22, U+8E2A, U+8EAC, U+8EB2, U+8EBA, U+8F68, U+8F83, U+8F8D, U+8F9B, U+8FA3, U+8FC8, U+8FEA, U+8FEB, U+8FF9, U+8FFD, U+9003, U+9010, U+901B, U+9022, U+9047, U+9057, U+9065, U+906D, U+906E, U+907F, U+9080, U+90C1, U+914D, U+9163, U+9165, U+916A, U+9178, U+91CA, U+9493, U+949E, U+94A5, U+94A6, U+94A9, U+94AE, U+9547, U+95F7, U+9635, U+9636, U+9644, U+9646, U+964B, U+964C, U+964D, U+966A, U+9676, U+9690, U+969C, U+96A7, U+96C4, U+96C5, U+96F7, U+970D, U+971C, U+9732, U+9738, U+9760, U+97A0, U+97AD, U+9876, U+987A, U+987F, U+988A, U+9965, U+996A, U+9970, U+9985, U+9988, U+9A71, U+9A84, U+9A8C, U+9AA4, U+9AA8, U+9B3C, U+9B42, U+9C81, U+9C8D, U+9CA8, U+9CB8, U+9E45, U+9E49, U+9E66, U+9E70, U+9EBB, U+9ED8, U+9EDB, U+9F99, U+9F9F; }
@font-face { font-family: "RHR Bold"; src: url("fonts/rhr-bold-x.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+4E01, U+4E08, U+4E10, U+4E11, U+4E13, U+4E22, U+4E27, U+4E38, U+4E39, U+4E3E, U+4E49, U+4E4E, U+4E4F, U+4E54, U+4E58, U+4E5E, U+4E71, U+4E89, U+4E8F, U+4EA1, U+4EA7, U+4ECB, U+4ED4, U+4EE3, U+4EEA, U+4EF0, U+4F01, U+4F0A, U+4F10, U+4F18, U+4F20, U+4F2F, U+4F34, U+4F38, U+4F3C, U+4F3D, U+4F46, U+4F4E, U+4F69, U+4F9B, U+4F9D, U+4FA3, U+4FA6, U+4FC3, U+4FC4, U+4FCA, U+4FD7, U+4FEF, U+4FF1, U+500D, U+5026, U+503E, U+5077, U+507F, U+50B2, U+5141, U+5151, U+51B3, U+51BB, U+51CC, U+51EF, U+520A, U+5218, U+521B, U+523B, U+526A, U+529D, U+52BF, U+52C3, U+52C7, U+52CB, U+52D2, U+5306, U+5319, U+5320, U+534F, U+5362, U+5373, U+5377, U+538B, U+538C, U+539A, U+53CA, U+53CC, U+53D7, U+53E0, U+53E3, U+53E4, U+53E5, U+53EB, U+5404, U+5409, U+5410, U+541B, U+541D, U+5420, U+5426, U+5428, U+5439, U+543B, U+5496, U+5499, U+54AC, U+54C7, U+54C8, U+5510, U+554A, U+5561, U+556C, U+5578, U+5589, U+559D, U+55B1, U+55EF, U+5618, U+5632, U+56E2, U+56F0, U+5708, U+5747, U+574A, U+5757, U+575B, U+5761, U+5766, U+57DF, U+57F9, U+582A, U+5851, U+585E, U+58A8, U+58A9, U+592B, U+592E, U+5947, U+5965, U+59AE, U+59BB, U+59C6, U+5A05, U+5A36, U+5A5A, U+5A92, U+5ACC, U+5AE9, U+5B59, U+5B64, U+5B98, U+5B9A, U+5B9D, U+5BBD, U+5BD3, U+5BFB, U+5C01, U+5C04, U+5C0A, U+5C16, U+5C18, U+5C1A, U+5C24, U+5C2C, U+5C34, U+5C3D, U+5C42, U+5C49, U+5C5E, U+5C96, U+5CA9, U+5CB8, U+5CF0, U+5D16, U+5DE2, U+5DE7, U+5E01, U+5E10, U+5E16, U+5E1D, U+5E2D, U+5E7B, U+5E7C, U+5E7D, U+5E7F, U+5E87, U+5E93, U+5E9C, U+5E9F, U+5EA7, U+5EC9, U+5ECA, U+5EF7, U+5F02, U+5F03, U+5F04, U+5F15, U+5F17, U+5F62, U+5F7B, U+5F7C, U+5F80, U+5F81, U+5F8B, U+5FB7, U+5FC6, U+5FE7, U+5FF5, U+6000, U+6001, U+6012, U+6025, U+602A, U+6050, U+6069, U+6070, U+6076, U+60A3, U+60A6, U+60A8, U+60AC, U+60B2, U+60D1, U+60DC, U+60E7, U+60E9, U+60F0, U+6108, U+6109, U+611A, U+6124, U+6148, U+614C, U+6167, U+618B, U+61BE, U+61D2, U+621A, U+624E, U+6251, U+6254, U+6258, U+6263, U+6267, U+6269, U+6298, U+629B, U+62B1, U+62BD, U+62CD, U+62D2, U+62D3, U+62DB, U+62DF, U+62E5, U+62EC, U+62EF, U+62F3, U+6302, U+6328, U+634E, U+6350, U+635F, U+6361, U+6363, U+6388, U+6392, U+63A7, U+63AA, U+63C9, U+63CF, U+63ED, U+63F4, U+641C, U+642D, U+6444, U+6467, U+6469, U+6491, U+6492, U+649E, U+64AD, U+64C5, U+653B, U+653F, U+654C, U+654F, U+6551, U+6562, U+656C, U+6572, U+65AF, U+65BD, U+65D7, U+65E2, U+65E7, U+65F1, U+6606, U+660F, U+6652, U+666E, U+667A, U+6697, U+66B4, U+66FC, U+671D, U+6728, U+6731, U+6734, U+6740, U+6749, U+674E, U+674F, U+6750, U+6770, U+6781, U+6784, U+679D, U+67AA, U+67D4, U+67DC, U+67F4, U+6842, U+6851, U+6863, U+6885, U+68A6, U+68A8, U+68AF, U+68CD, U+6912, U+695A, U+697C, U+6982, U+6B27, U+6B49, U+6B62, U+6B64, U+6B7B, U+6BC1, U+6BD2, U+6BD5, U+6BEB, U+6C38, U+6C47, U+6C5F, U+6C60, U+6C9B, U+6C9F, U+6CAB, U+6CAE, U+6CB8, U+6CBB, U+6CDB, U+6CE2, U+6CE5, U+6CEA, U+6D1B, U+6D1E, U+6D32, U+6D3D, U+6D4E, U+6D52, U+6D53, U+6D6E, U+6DB2, U+6DC6, U+6DD8, U+6DE1, U+6DF1, U+6DF7, U+6DF9, U+6DFB, U+6E10, U+6E14, U+6E34, U+6EDA, U+6EE4, U+6F02, U+6F06, U+6F2B, U+6F58, U+6F5C, U+6F6E, U+6FA1, U+6FC0, U+704C, U+706D, U+7075, U+7076, U+7089, U+7092, U+70B8, U+70C8, U+70D8, U+70D9, U+70E4, U+70E6, U+70F9, U+7119, U+7126, U+7130, U+714E, U+716E, U+71C3, U+7235, U+7261, U+72AF, U+72B6, U+72C2, U+72C4, U+72E9, U+72EC, U+72ED, U+72FC, U+730E, U+731C, U+732E, U+7389, U+738B, U+73AB, U+73C0, U+73CD, U+7433, U+743C, U+745A, U+745C, U+745F, U+7470, U+751C, U+7545, U+7565, U+7591, U+7597, U+75AF, U+75B2, U+75BE, U+75C7, U+7600, U+764C, U+76CA, U+76D0, U+76D6, U+76DB, U+76F8, U+76FC, U+7701, U+77A7, U+780D, U+7814, U+7834, U+786C, U+788E, U+78B0, U+78C1, U+78E8, U+7901, U+7965, U+798F, U+79BB, U+79C0, U+79C1, U+79E9, U+7A0D, U+7A46, U+7A76, U+7A77, U+7A81, U+7A84, U+7A8D, U+7A9F, U+7ACB, U+7ADE, U+7ADF, U+7AE5, U+7B1B, U+7B3C, U+7B56, U+7B80, U+7B97, U+7BC7, U+7C97, U+7CA5, U+7CB9, U+7CFB, U+7D20, U+7EA4, U+7EAA, U+7EB2, U+7EB3, U+7EBD, U+7EC4, U+7EC6, U+7EC7, U+7ECD, U+7ED5, U+7EDD, U+7EDF, U+7EEA, U+7EF4, U+7EF8, U+7F38, U+7F3A, U+7F55, U+7F5A, U+7F69, U+7F9E, U+7FA4, U+7FBD, U+7FC5, U+7FD4, U+7FF0, U+7FFB, U+8000, U+800C, U+8010, U+8015, U+804B, U+8083, U+8098, U+809A, U+80A4, U+80A5, U+80A9, U+80AA, U+80AF, U+80C3, U+80CE, U+80DE, U+8102, U+8116, U+8131, U+813E, U+814A, U+8150, U+8170, U+8180, U+819D, U+8212, U+8247, U+8273, U+827E, U+828D, U+82AC, U+82BD, U+82D4, U+82D7, U+82DB, U+82E6, U+831C, U+8363, U+836F, U+838E, U+83AB, U+83C7, U+83CC, U+8425, U+8428, U+846C, U+8471, U+8482, U+8499, U+84B8, U+8537, U+853D, U+8587, U+85AA, U+85AF, U+85D3, U+85E4, U+8611, U+8651, U+865A, U+867D, U+8681, U+8682, U+86C7, U+878D, U+8822, U+8840, U+8861, U+88AB, U+88C2, U+8986, U+8A79, U+8BAD, U+8BAF, U+8BB6, U+8BBF, U+8BC0, U+8BC1, U+8BC4, U+8BCA, U+8BD7, U+8BDA, U+8BFA, U+8C05, U+8C0E, U+8C10, U+8C1A, U+8C22, U+8C31, U+8C37, U+8C4C, U+8C5A, U+8C6A, U+8C79, U+8C8C, U+8D1D, U+8D21, U+8D22, U+8D23, U+8D26, U+8D28, U+8D2B, U+8D2D, U+8D3A, U+8D3E, U+8D4B, U+8D4F, U+8D56, U+8D5A, U+8D5E, U+8D60, U+8D64, U+8D6B, U+8D76, U+8DC3, U+8DDD, U+8DDF, U+8DF5, U+8E0F, U+8E22, U+8E2A, U+8EAC, U+8EB2, U+8EBA, U+8F68, U+8F83, U+8F8D, U+8F9B, U+8FA3, U+8FC8, U+8FEA, U+8FEB, U+8FF9, U+8FFD, U+9003, U+9010, U+901B, U+9022, U+9047, U+9057, U+9065, U+906D, U+906E, U+907F, U+9080, U+90C1, U+914D, U+9163, U+9165, U+916A, U+9178, U+91CA, U+9493, U+949E, U+94A5, U+94A6, U+94A9, U+94AE, U+9547, U+95F7, U+9635, U+9636, U+9644, U+9646, U+964B, U+964C, U+964D, U+966A, U+9676, U+9690, U+969C, U+96A7, U+96C4, U+96C5, U+96F7, U+970D, U+971C, U+9732, U+9738, U+9760, U+97A0, U+97AD, U+9876, U+987A, U+987F, U+988A, U+9965, U+996A, U+9970, U+9985, U+9988, U+9A71, U+9A84, U+9A8C, U+9AA4, U+9AA8, U+9B3C, U+9B42, U+9C81, U+9C8D, U+9CA8, U+9CB8, U+9E45, U+9E49, U+9E66, U+9E70, U+9EBB, U+9ED8, U+9EDB, U+9F99, U+9F9F; }
@font-face { font-family: "RHR Heavy"; src: url("fonts/rhr-heavy-h.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+4E1B, U+4E32, U+4E73, U+4E88, U+4EC1, U+4EC6, U+4ED1, U+4F19, U+4F2A, U+4F30, U+4F5B, U+4F84, U+4FA7, U+4FB5, U+4FF3, U+5021, U+503A, U+504F, U+508D, U+50AC, U+50F5, U+5112, U+517D, U+51DD, U+51E1, U+5203, U+5242, U+5243, U+5272, U+52D8, U+5360, U+5375, U+5398, U+53BF, U+53D9, U+53F9, U+5401, U+541E, U+541F, U+543C, U+5448, U+5480, U+5486, U+54A8, U+54B8, U+54BD, U+54C0, U+54E8, U+54EE, U+54F2, U+54FA, U+54FD, U+5507, U+552F, U+5564, U+5598, U+55B7, U+55BB, U+5609, U+563B, U+568F, U+56BC, U+56FA, U+575D, U+575F, U+576A, U+5782, U+5792, U+57CB, U+5806, U+5835, U+584C, U+5858, U+586B, U+5893, U+58C1, U+58F3, U+58F6, U+5915, U+5938, U+593A, U+5949, U+5962, U+5986, U+5992, U+5999, U+59D4, U+59FB, U+59FF, U+5A18, U+5A31, U+5A6A, U+5B55, U+5B6A, U+5B75, U+5B85, U+5B8F, U+5B97, U+5BA1, U+5BA3, U+5BB4, U+5BBF, U+5BD2, U+5BF8, U+5BFA, U+5C48, U+5C60, U+5C65, U+5CE1, U+5D29, U+5DDD, U+5DE1, U+5E15, U+5E18, U+5E1A, U+5ED3, U+5EF6, U+5F0A, U+5F13, U+5F26, U+5F27, U+5F2F, U+5F79, U+5F84, U+5F99, U+5FA1, U+5FCC, U+5FCD, U+5FE0, U+5FFD, U+6016, U+6028, U+6055, U+606D, U+6073, U+607C, U+609F, U+60BC, U+60E0, U+60EB, U+60ED, U+6101, U+6127, U+6155, U+6168, U+6170, U+6177, U+61CA, U+6212, U+622A, U+626D, U+6270, U+6276, U+6279, U+6293, U+6295, U+6297, U+62B5, U+62BC, U+62D6, U+62D8, U+62E8, U+62F1, U+62FD, U+6316, U+6321, U+6323, U+6398, U+63B7, U+63C4, U+63F6, U+6401, U+6405, U+640F, U+6454, U+64CE, U+652B, U+659C, U+65CB, U+6620, U+6655, U+6670, U+6687, U+6726, U+6743, U+6746, U+675C, U+6760, U+6790, U+6795, U+67AB, U+67CF, U+67D3, U+67F1, U+6805, U+680F, U+6816, U+6838, U+6843, U+6846, U+68B0, U+68C9, U+68DA, U+6984, U+699C, U+6A31, U+6A44, U+6A71, U+6B20, U+6B23, U+6B32, U+6B3A, U+6B47, U+6B8B, U+6BC5, U+6BEF, U+6C1B, U+6C22, U+6C27, U+6C57, U+6C89, U+6CBC, U+6CC4, U+6CC9, U+6CE3, U+6CF5, U+6CFB, U+6D12, U+6D45, U+6D46, U+6D82, U+6D89, U+6DA6, U+6E21, U+6E7E, U+6EA2, U+6EAA, U+6EAF, U+6EBA, U+6EE5, U+6EE8, U+6F0F, U+6F84, U+7096, U+70AE, U+70F7, U+718F, U+7194, U+71A8, U+7262, U+72B9, U+72F1, U+731B, U+74F7, U+7518, U+7525, U+7532, U+7533, U+758F, U+759A, U+759F, U+75AB, U+75B1, U+75D5, U+7601, U+7620, U+763E, U+7682, U+76B1, U+76C6, U+76D1, U+76D7, U+76FE, U+7709, U+7729, U+7763, U+77AC, U+77DB, U+77FF, U+7816, U+786B, U+788D, U+7891, U+789F, U+78B3, U+7948, U+7949, U+7977, U+7978, U+7981, U+7A00, U+7A0E, U+7A3C, U+7A3D, U+7A3F, U+7A83, U+7A92, U+7A9D, U+7B03, U+7B4B, U+7B52, U+7B79, U+7C07, U+7C4D, U+7C92, U+7CB1, U+7CCA, U+7CD9, U+7E41, U+7EAF, U+7EB5, U+7EB9, U+7ECA, U+7EFC, U+7F15, U+7F18, U+7F1D, U+7F62, U+7F6A, U+7F9A, U+7FA1, U+7FE0, U+7FE1, U+8017, U+803D, U+808C, U+80A0, U+80B4, U+80BA, U+80BF, U+80C1, U+80C6, U+80E7, U+80F8, U+8106, U+8109, U+8154, U+8155, U+816E, U+8179, U+817E, U+819B, U+81A8, U+81B3, U+81E3, U+820D, U+822C, U+8230, U+8231, U+8270, U+82AD, U+82AF, U+8352, U+8361, U+83F1, U+8463, U+849C, U+84BF, U+857E, U+8650, U+868A, U+86A4, U+8759, U+8760, U+8845, U+8870, U+8877, U+888D, U+88AD, U+88F9, U+8910, U+892A, U+8A89, U+8BA2, U+8BD1, U+8BE2, U+8BF5, U+8C0B, U+8C0D, U+8C1C, U+8C23, U+8C26, U+8C2C, U+8C34, U+8C6B, U+8D1F, U+8D27, U+8D29, U+8D2A, U+8D2F, U+8D37, U+8D4C, U+8D8B, U+8DDB, U+8DE4, U+8DE8, U+8E1D, U+8E66, U+8F70, U+8F86, U+8F90, U+8F9C, U+8F9E, U+8FA8, U+8FA9, U+8FBD, U+8FC1, U+9006, U+900A, U+900F, U+902E, U+903B, U+903C, U+9063, U+90AA, U+90CA, U+90CE, U+90E1, U+9152, U+916C, U+9171, U+918B, U+9488, U+9489, U+94BB, U+950B, U+9526, U+956D, U+9602, U+9610, U+9614, U+9631, U+9634, U+963B, U+9648, U+9677, U+9686, U+96C7, U+96CC, U+96D5, U+9709, U+9774, U+9776, U+97E7, U+97F5, U+988C, U+9896, U+989D, U+98D3, U+99A8, U+9A6F, U+9A97, U+9AD3, U+9B45, U+9C40, U+9CCD, U+9E26, U+9E2B, U+9EA6, U+9F84; }
@font-face { font-family: "RHR Bold"; src: url("fonts/rhr-bold-h.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+4E1B, U+4E32, U+4E73, U+4E88, U+4EC1, U+4EC6, U+4ED1, U+4F19, U+4F2A, U+4F30, U+4F5B, U+4F84, U+4FA7, U+4FB5, U+4FF3, U+5021, U+503A, U+504F, U+508D, U+50AC, U+50F5, U+5112, U+517D, U+51DD, U+51E1, U+5203, U+5242, U+5243, U+5272, U+52D8, U+5360, U+5375, U+5398, U+53BF, U+53D9, U+53F9, U+5401, U+541E, U+541F, U+543C, U+5448, U+5480, U+5486, U+54A8, U+54B8, U+54BD, U+54C0, U+54E8, U+54EE, U+54F2, U+54FA, U+54FD, U+5507, U+552F, U+5564, U+5598, U+55B7, U+55BB, U+5609, U+563B, U+568F, U+56BC, U+56FA, U+575D, U+575F, U+576A, U+5782, U+5792, U+57CB, U+5806, U+5835, U+584C, U+5858, U+586B, U+5893, U+58C1, U+58F3, U+58F6, U+5915, U+5938, U+593A, U+5949, U+5962, U+5986, U+5992, U+5999, U+59D4, U+59FB, U+59FF, U+5A18, U+5A31, U+5A6A, U+5B55, U+5B6A, U+5B75, U+5B85, U+5B8F, U+5B97, U+5BA1, U+5BA3, U+5BB4, U+5BBF, U+5BD2, U+5BF8, U+5BFA, U+5C48, U+5C60, U+5C65, U+5CE1, U+5D29, U+5DDD, U+5DE1, U+5E15, U+5E18, U+5E1A, U+5ED3, U+5EF6, U+5F0A, U+5F13, U+5F26, U+5F27, U+5F2F, U+5F79, U+5F84, U+5F99, U+5FA1, U+5FCC, U+5FCD, U+5FE0, U+5FFD, U+6016, U+6028, U+6055, U+606D, U+6073, U+607C, U+609F, U+60BC, U+60E0, U+60EB, U+60ED, U+6101, U+6127, U+6155, U+6168, U+6170, U+6177, U+61CA, U+6212, U+622A, U+626D, U+6270, U+6276, U+6279, U+6293, U+6295, U+6297, U+62B5, U+62BC, U+62D6, U+62D8, U+62E8, U+62F1, U+62FD, U+6316, U+6321, U+6323, U+6398, U+63B7, U+63C4, U+63F6, U+6401, U+6405, U+640F, U+6454, U+64CE, U+652B, U+659C, U+65CB, U+6620, U+6655, U+6670, U+6687, U+6726, U+6743, U+6746, U+675C, U+6760, U+6790, U+6795, U+67AB, U+67CF, U+67D3, U+67F1, U+6805, U+680F, U+6816, U+6838, U+6843, U+6846, U+68B0, U+68C9, U+68DA, U+6984, U+699C, U+6A31, U+6A44, U+6A71, U+6B20, U+6B23, U+6B32, U+6B3A, U+6B47, U+6B8B, U+6BC5, U+6BEF, U+6C1B, U+6C22, U+6C27, U+6C57, U+6C89, U+6CBC, U+6CC4, U+6CC9, U+6CE3, U+6CF5, U+6CFB, U+6D12, U+6D45, U+6D46, U+6D82, U+6D89, U+6DA6, U+6E21, U+6E7E, U+6EA2, U+6EAA, U+6EAF, U+6EBA, U+6EE5, U+6EE8, U+6F0F, U+6F84, U+7096, U+70AE, U+70F7, U+718F, U+7194, U+71A8, U+7262, U+72B9, U+72F1, U+731B, U+74F7, U+7518, U+7525, U+7532, U+7533, U+758F, U+759A, U+759F, U+75AB, U+75B1, U+75D5, U+7601, U+7620, U+763E, U+7682, U+76B1, U+76C6, U+76D1, U+76D7, U+76FE, U+7709, U+7729, U+7763, U+77AC, U+77DB, U+77FF, U+7816, U+786B, U+788D, U+7891, U+789F, U+78B3, U+7948, U+7949, U+7977, U+7978, U+7981, U+7A00, U+7A0E, U+7A3C, U+7A3D, U+7A3F, U+7A83, U+7A92, U+7A9D, U+7B03, U+7B4B, U+7B52, U+7B79, U+7C07, U+7C4D, U+7C92, U+7CB1, U+7CCA, U+7CD9, U+7E41, U+7EAF, U+7EB5, U+7EB9, U+7ECA, U+7EFC, U+7F15, U+7F18, U+7F1D, U+7F62, U+7F6A, U+7F9A, U+7FA1, U+7FE0, U+7FE1, U+8017, U+803D, U+808C, U+80A0, U+80B4, U+80BA, U+80BF, U+80C1, U+80C6, U+80E7, U+80F8, U+8106, U+8109, U+8154, U+8155, U+816E, U+8179, U+817E, U+819B, U+81A8, U+81B3, U+81E3, U+820D, U+822C, U+8230, U+8231, U+8270, U+82AD, U+82AF, U+8352, U+8361, U+83F1, U+8463, U+849C, U+84BF, U+857E, U+8650, U+868A, U+86A4, U+8759, U+8760, U+8845, U+8870, U+8877, U+888D, U+88AD, U+88F9, U+8910, U+892A, U+8A89, U+8BA2, U+8BD1, U+8BE2, U+8BF5, U+8C0B, U+8C0D, U+8C1C, U+8C23, U+8C26, U+8C2C, U+8C34, U+8C6B, U+8D1F, U+8D27, U+8D29, U+8D2A, U+8D2F, U+8D37, U+8D4C, U+8D8B, U+8DDB, U+8DE4, U+8DE8, U+8E1D, U+8E66, U+8F70, U+8F86, U+8F90, U+8F9C, U+8F9E, U+8FA8, U+8FA9, U+8FBD, U+8FC1, U+9006, U+900A, U+900F, U+902E, U+903B, U+903C, U+9063, U+90AA, U+90CA, U+90CE, U+90E1, U+9152, U+916C, U+9171, U+918B, U+9488, U+9489, U+94BB, U+950B, U+9526, U+956D, U+9602, U+9610, U+9614, U+9631, U+9634, U+963B, U+9648, U+9677, U+9686, U+96C7, U+96CC, U+96D5, U+9709, U+9774, U+9776, U+97E7, U+97F5, U+988C, U+9896, U+989D, U+98D3, U+99A8, U+9A6F, U+9A97, U+9AD3, U+9B45, U+9C40, U+9CCD, U+9E26, U+9E2B, U+9EA6, U+9F84; }
/* rhr-ext:end */
@font-face { font-family: "Andika"; src: url("fonts/andika-bold.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Dela Gothic One"; src: url("fonts/dela-gothic-one.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url("fonts/zen-maru-gothic-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url("fonts/zen-maru-gothic-black.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --ink: #1b1d4d;
  --paper: #fff8ec;
  --blue: #3b6bff;
  --pink: #ff7ab6;
  --pink-soft: #ffd0e4;
  --blue-soft: #d9e4ff;
  --yellow: #ffd23f;
  --mint: #3fdcb0;
  --violet: #a77bff;
  --red: #ff4f6d;
  --E: 0;
  --kick: 0;
  --round: "Zen Maru Gothic", "RHR Bold", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --chunky: "Dela Gothic One", "RHR Heavy", "PingFang SC", "Microsoft YaHei", sans-serif;
  --word: "Andika", "Zen Maru Gothic", sans-serif;
  --kyoka: "Klee One", "UD Digi Kyokasho N-R", "YuKyokasho", "Zen Maru Gothic", serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--round);
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }

#paper {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 122, 182, .16) 0 120px, transparent 121px),
    radial-gradient(circle at 88% 78%, rgba(59, 107, 255, .12) 0 160px, transparent 161px),
    linear-gradient(rgba(59, 107, 255, .11) 1.5px, transparent 1.5px) 0 0 / 26px 26px,
    linear-gradient(90deg, rgba(59, 107, 255, .11) 1.5px, transparent 1.5px) 0 0 / 26px 26px,
    var(--paper);
}
#rays-fallback {
  display: none; position: fixed; inset: -50vmax; z-index: 1; opacity: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg at 50% 50%, #3b6bff 0 9deg, #ff7ab6 9deg 18deg);
}
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
#fx-back { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
#actors { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; overflow: visible; }
#cutins { position: fixed; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
#flash { position: fixed; inset: 0; z-index: 7; pointer-events: none; background: #fff; opacity: 0; }
.dk-digit { font-family: var(--round); font-weight: 900; fill: var(--ink); stroke: #fff; stroke-width: 6px; paint-order: stroke; }

#app {
  position: relative; z-index: 2;
  width: min(100vw, 460px); height: 100dvh; max-height: 980px;
  margin: 0 auto;
}
@media (min-height: 980px) { #app { top: calc((100dvh - 980px) / 2); } }
.screen { position: absolute; inset: 0; display: none; }
.screen.is-active { display: flex; }

/* ------------------------------------------------------------ title */
#screen-title { flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px; padding: calc(28px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
#screen-title > * { flex: none; }
/* Logo: layered paper cut-outs. A spinning burst sits behind "ドパ",
   "ドリル" rides on a folded ribbon, operator scraps float around. */
.logo { position: relative; margin: calc(var(--fs) * 0.62) 0 calc(var(--fs) * 0.2); display: grid; justify-items: center; font-family: var(--chunky); font-weight: 400; line-height: 1; --fs: clamp(64px, 21vw, 96px); }
.logo-burst { position: absolute; left: 50%; top: calc(var(--fs) * 0.52); width: calc(var(--fs) * 2.7); height: calc(var(--fs) * 2.7); transform: translate(-50%, -50%) rotate(calc(var(--spin, 0) * 1deg)); z-index: -1; filter: drop-shadow(0 6px 0 rgba(27, 29, 77, .9)); }
.logo-top { display: flex; gap: .02em; font-size: var(--fs); letter-spacing: -.04em; }
.logo i { font-style: normal; display: inline-block; position: relative; }
.logo-top i {
  color: #fff;
  /* white paper edge, ink outline, then an offset second sheet */
  text-shadow:
    0 0 0 #fff,
    3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
    2.5px 2.5px 0 var(--ink), -2.5px 2.5px 0 var(--ink), 2.5px -2.5px 0 var(--ink), -2.5px -2.5px 0 var(--ink),
    6px 7px 0 var(--pink), 8px 9px 0 var(--ink), 4px 10px 0 var(--ink);
  transform: rotate(var(--r, -6deg)) translateY(var(--dy, 0));
  animation: logo-hop 1.6s cubic-bezier(.3, 1.6, .5, 1) infinite;
}
.logo-top i:nth-child(1) { --r: -9deg; color: #fff; }
.logo-top i:nth-child(2) { --r: 7deg; --dy: -6px; animation-delay: -.8s; }
.logo-top i::after { content: attr(data-c); position: absolute; inset: 0; color: var(--blue); clip-path: polygon(0 62%, 100% 50%, 100% 100%, 0 100%); text-shadow: none; }
.logo-top i:nth-child(2)::after { color: var(--pink); }
.logo-ribbon { position: relative; display: flex; justify-content: center; gap: .1em; margin-top: calc(var(--fs) * 0.04); padding: .12em .9em .2em; font-size: calc(var(--fs) * 0.52); color: #fff; transform: rotate(-3deg); }
.ribbon-bg { position: absolute; inset: -6% -14% -10%; width: 128%; height: 116%; z-index: -1; filter: drop-shadow(0 5px 0 var(--ink)); }
.logo-ribbon i { text-shadow: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink), 0 4px 0 var(--ink); animation: logo-wave 1.6s ease-in-out infinite; }
.logo-ribbon i:nth-child(3) { animation-delay: -.25s; }
.logo-ribbon i:nth-child(4) { animation-delay: -.5s; }
.logo-bits { position: absolute; inset: 0; pointer-events: none; }
.logo-bits b { position: absolute; left: calc(50% + var(--x)); top: var(--y); font-size: calc(var(--fs) * 0.4); color: var(--c); transform: translate(-50%, -50%) rotate(var(--r)); text-shadow: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink), 3px 4px 0 var(--ink); animation: logo-float 2.4s ease-in-out infinite; }
.logo-bits b:nth-child(2) { animation-delay: -.6s; }
.logo-bits b:nth-child(3) { animation-delay: -1.2s; }
.logo-bits b:nth-child(4) { animation-delay: -1.8s; }
@keyframes logo-hop { 0%, 100% { transform: rotate(var(--r)) translateY(var(--dy, 0)) scale(1); } 12% { transform: rotate(var(--r)) translateY(calc(var(--dy, 0px) + 4px)) scale(1.08, .9); } 30% { transform: rotate(calc(var(--r) * -0.4)) translateY(calc(var(--dy, 0px) - 10px)) scale(.96, 1.06); } 55% { transform: rotate(var(--r)) translateY(var(--dy, 0)) scale(1); } }
@keyframes logo-wave { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes logo-float { 0%, 100% { margin-top: 0; } 50% { margin-top: -8px; } }
body.reduced .logo *, body.reduced .logo-burst { animation: none !important; }
.settings-btn { display: grid; place-items: center; position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 14px; width: 48px; height: 48px; padding: 4px; background: #fff; box-shadow: 0 4px 0 var(--ink); z-index: 3; }
.settings-btn svg { display: block; width: 100%; height: 100%; transition: transform .4s; }
#open-settings:active svg { transform: rotate(90deg); }
.modes { display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* ------------------------------------------------------------ settings */
.modal { position: fixed; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(27, 29, 77, .45); }
.modal[hidden] { display: none; }
.modal-card { width: min(100%, 420px); max-height: 100%; overflow: auto; display: flex; flex-direction: column; align-items: stretch; gap: 16px; padding: 22px 18px 20px; border: 3.5px solid var(--ink); border-radius: 26px; background: var(--paper); box-shadow: 0 8px 0 var(--ink); }
.modal-card .chip { align-self: center; margin: 0; font-size: 18px; }
.modal-card .big-btn { align-self: center; min-width: 200px; height: 58px; font-size: 24px; }
.set-row { display: flex; flex-direction: column; gap: 8px; }
.set-label { font-weight: 900; font-size: 16px; }
.set-label b { font-family: var(--chunky); font-weight: 400; color: var(--blue); margin-left: 6px; }
.set-inline { display: flex; align-items: center; gap: 12px; }
.set-inline .slider { flex: 1; }
.set-note { margin: 0; font-size: 12px; opacity: .7; }
.reset-btn { align-self: center; min-width: 230px; font-weight: 900; }
.modal .pick { justify-content: center; }
.modal .pick button { width: 30%; max-width: 96px; }
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; margin: 0; --v: 1; }
.slider::-webkit-slider-runnable-track { height: 14px; border: 2.5px solid var(--ink); border-radius: 999px; background: linear-gradient(90deg, var(--pink) 0 calc(var(--v) * 100%), #fff calc(var(--v) * 100%)); }
.slider::-moz-range-track { height: 10px; border: 2.5px solid var(--ink); border-radius: 999px; background: linear-gradient(90deg, var(--pink) 0 calc(var(--v) * 100%), #fff calc(var(--v) * 100%)); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 32px; height: 32px; margin-top: -11px; border: 3px solid var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.slider::-moz-range-thumb { width: 26px; height: 26px; border: 3px solid var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.slider.motion::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--blue-soft), var(--pink) 50%, var(--yellow)) 0 0 / calc(var(--v) * 100%) 100% no-repeat, #fff; }
.slider.motion::-moz-range-track { background: linear-gradient(90deg, var(--blue-soft), var(--pink) 50%, var(--yellow)) 0 0 / calc(var(--v) * 100%) 100% no-repeat, #fff; }
.title-stage { width: 100%; height: min(26vh, 200px); }
.pick { display: flex; gap: 10px; }
.pick button {
  width: 84px; height: 56px; border: 3px solid var(--ink); border-radius: 16px; background: #fff;
  font-family: var(--chunky); font-size: 26px; box-shadow: 0 5px 0 var(--ink); transition: transform .08s;
}
.pick button small { font-family: var(--round); font-size: 14px; margin-left: 2px; }
.pick button[aria-checked="true"] { background: var(--yellow); transform: translateY(-3px) rotate(-2deg); }
.big-btn {
  min-width: 240px; height: 68px; padding: 0 28px; border: 3.5px solid var(--ink); border-radius: 22px;
  background: var(--blue); color: #fff; font-family: var(--chunky); font-size: 28px; letter-spacing: .06em;
  box-shadow: 0 7px 0 var(--ink); text-shadow: 0 3px 0 rgba(27, 29, 77, .55);
}
.big-btn small { font-family: var(--round); font-size: 16px; }
.big-btn:active, .sub-btn:active, .pick button:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--ink); }
.sub-btn { min-width: 160px; height: 52px; border: 3px solid var(--ink); border-radius: 18px; background: #fff; font-size: 18px; box-shadow: 0 5px 0 var(--ink); }
.toggles { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.toggle { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 2.5px solid var(--ink); border-radius: 999px; background: #fff; font-size: 14px; }
.toggle i { font-style: normal; font-size: 16px; }
.toggle b { font-weight: 900; color: var(--blue); }
.toggle[aria-pressed="true"][data-toggle="motion"] b { color: var(--pink); }
.hint { margin: 0; font-size: 12px; opacity: .6; }

/* ------------------------------------------------------------ play */
#screen-play { flex-direction: column; padding: 8px 0 calc(10px + env(safe-area-inset-bottom)); }
.hud { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; }
.pips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; align-items: center; }
.pip { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; }
.pips.many .pip { width: 11px; height: 11px; border-width: 2px; }
.pip.now { background: var(--yellow); animation: pip 0.8s ease-in-out infinite; }
.pip.done { background: var(--c, var(--blue)); }
.pip.rainbow { background: conic-gradient(#ff7ab6, #ffd23f, #3fdcb0, #3b6bff, #a77bff, #ff7ab6); }
@keyframes pip { 50% { transform: scale(1.3); } }
.clock { display: flex; align-items: baseline; gap: 8px; padding: 4px 12px; border: 2.5px solid var(--ink); border-radius: 999px; background: #fff; font-size: 12px; white-space: nowrap; }
.clock b { font-family: var(--chunky); font-weight: 400; font-size: 18px; font-variant-numeric: tabular-nums; }
.clock.over #clock-label { color: var(--red); }
.clock.extra { background: var(--ink); color: #fff; }
.clock.extra b { color: var(--yellow); font-size: 20px; }
.clock.hurry b { color: var(--red); animation: hurry .5s steps(2) infinite; }
@keyframes hurry { 50% { color: #fff; } }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; font-size: 18px; flex: none; }
.icon-btn[aria-pressed="true"] { background: var(--ink); color: #fff; text-decoration: line-through; }

.hud2 { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 40px; padding: 0 14px; }
.tally { display: flex; gap: 6px; font-size: 13px; }
.tally span { padding: 3px 10px; border-radius: 999px; background: #fff; border: 2px solid var(--ink); }
.tally b { font-family: var(--chunky); font-weight: 400; font-size: 16px; }
.tally small { font-size: 11px; opacity: .6; }
.tally .ng b { color: var(--violet); }
.dopa {
  display: flex; align-items: baseline; gap: 6px; max-width: 62%;
  padding: 3px 12px 4px; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--yellow);
  box-shadow: 0 3px 0 var(--ink); transform-origin: right center; white-space: nowrap; overflow: hidden;
}
.dopa small { font-size: 11px; }
.dopa b { font-family: var(--chunky); font-weight: 400; font-size: 20px; letter-spacing: .01em; }
body.lv6 .dopa { background: linear-gradient(90deg, #ffd23f, #ff9ccc, #9fd0ff, #ffd23f); background-size: 300% 100%; animation: dopa-sheen 2s linear infinite; }
@keyframes dopa-sheen { to { background-position: 300% 0; } }
/* Combo (id032): floats under the tally, over the stage's top-left corner. */
.combo {
  position: absolute; left: 14px; top: calc(100% + 2px); display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 4px;
  padding: 2px 10px 10px; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; box-shadow: 0 3px 0 var(--ink);
  transform-origin: left center; opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s; pointer-events: none;
}
.combo.on { opacity: 1; visibility: visible; }
.combo b { font-family: var(--chunky); font-weight: 400; font-size: 22px; line-height: 1.1; color: var(--pink); }
.combo small { font-size: 11px; font-weight: 900; }
.combo-mult { grid-column: 1 / -1; font-size: 10px; font-weight: 900; opacity: .7; }
.combo-track { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 4px; border-radius: 2px; background: #e6e4f0; overflow: hidden; }
.combo-track i { position: absolute; inset: 0; background: var(--blue); transform-origin: left center; }
.combo.hot { background: #fff4c4; }
.combo.hot b { color: var(--red); }
.combo.hot .combo-mult { opacity: 1; color: var(--red); }
.combo.hurry .combo-track i { background: var(--red); }

.stage { position: relative; flex: 1 1 auto; min-height: 118px; margin: 0 14px; }
.ground { position: absolute; left: 6%; right: 6%; bottom: 6px; width: 88%; height: 14px; }
.bunting { position: absolute; left: -2%; right: -2%; top: 0; width: 104%; height: 34px; opacity: 0; transform: translateY(-20px); transition: opacity .5s, transform .5s cubic-bezier(.3, 1.6, .5, 1); }
body.lv3 .bunting { opacity: 1; transform: none; }
.spot { position: absolute; top: -30px; width: 140px; height: 190px; opacity: 0; transition: opacity .6s; mix-blend-mode: screen; filter: blur(2px);
  background: linear-gradient(to bottom, rgba(255, 246, 200, .95), rgba(255, 246, 200, 0)); clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%); }
.spot-l { left: 0; transform-origin: 50% 0; animation: spot-l 3s ease-in-out infinite; }
.spot-r { right: 0; transform-origin: 50% 0; animation: spot-r 3.4s ease-in-out infinite; }
body.lv5 .spot { opacity: .7; }
@keyframes spot-l { 0%, 100% { transform: rotate(-24deg); } 50% { transform: rotate(10deg); } }
@keyframes spot-r { 0%, 100% { transform: rotate(24deg); } 50% { transform: rotate(-12deg); } }

.card {
  position: relative; margin: 0 14px 12px; padding: 10px 12px 10px;
  background: #fff; border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 7px 0 var(--ink);
  transform-origin: 50% 100%;
}
.card-top { display: flex; justify-content: space-between; align-items: center; }
.chip { display: inline-block; margin: 0; padding: 3px 12px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 13px; letter-spacing: .08em; }
.qno { font-family: var(--round); font-weight: 900; font-size: 15px; }
.sheet-wrap { display: flex; justify-content: center; align-items: center; min-height: 208px; padding: 4px 0 2px; }
.sheet { position: relative; display: grid; grid-template-columns: repeat(var(--cols), var(--cw)); grid-template-rows: repeat(var(--rows), var(--ch)); --cw: 54px; --ch: 52px; font-family: var(--round); font-weight: 900; }
.cell { position: relative; display: grid; place-items: center; font-size: calc(var(--ch) * .82); line-height: 1; font-variant-numeric: tabular-nums; }
.sheet.div .cell { font-size: calc(var(--ch) * .88); }
.cell.op { color: var(--blue); font-size: calc(var(--ch) * .7); }
.cell.small { align-self: end; font-size: clamp(12px, calc(var(--ch) * .38), 19px); color: var(--pink); height: calc(var(--ch) * .46); }
.cell.mark { color: var(--blue); font-size: clamp(11px, calc(var(--ch) * .34), 17px); letter-spacing: -.04em; }
.cell.struck::after { content: ""; position: absolute; left: 18%; right: 18%; top: 50%; height: 3.5px; background: var(--blue); border-radius: 2px; transform: rotate(-32deg); }
.cell.hidden { visibility: hidden; }
.cell.input { margin: 3px; border-radius: 12px; }
.cell.input.active { background: var(--blue-soft); outline: 3px dashed var(--blue); outline-offset: -3px; animation: active-cell 1s ease-in-out infinite; }
.cell.input.active::before { content: "?"; color: rgba(59, 107, 255, .35); }
.cell.input.active.has::before { content: none; }
.cell.input.ok { color: var(--ink); }
.cell.input.bad { color: #7a4bff; background: #efe8ff; outline: 3px dashed #a77bff; outline-offset: -3px; animation: none; }
.cell.hint-glow { border-radius: 8px; background: #fff3b8; box-shadow: 0 0 0 3px var(--yellow); animation: hint-glow .9s ease-in-out infinite; }
@keyframes hint-glow { 50% { box-shadow: 0 0 0 6px rgba(255, 210, 63, .5); } }
body.reduced .cell.hint-glow { animation: none; }
.help-text { display: inline-block; margin-left: 8px; padding: 1px 10px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-weight: 900; }
.cell.input.pending { color: transparent; }
@keyframes active-cell { 50% { background: #c4d5ff; } }
.cell.auto { color: #5a5f93; }
.hline { position: relative; align-self: end; height: 3.5px; background: var(--ink); border-radius: 2px; margin-bottom: -2px; transform-origin: left center; }
.hline.hidden { visibility: hidden; }
.bracket { position: relative; border-top: 3.5px solid var(--ink); margin-left: 4px; }
.bracket::before { content: ""; position: absolute; left: -14px; top: -3.5px; width: 14px; height: calc(100% + 4px); border-right: 3.5px solid var(--ink); border-radius: 0 70% 70% 0 / 0 50% 50% 0; }
.step-label { margin: 2px 0 0; text-align: center; font-size: 14px; min-height: 20px; }
.step-label b { color: var(--blue); }

.stamp {
  position: absolute; right: 14px; top: 34px; width: 110px; height: 110px; border-radius: 50%; border: 9px solid var(--red); opacity: 0;
  box-shadow: inset 0 0 0 3px rgba(255, 79, 109, .3); pointer-events: none;
}
.reach-tag {
  position: absolute; left: 50%; bottom: -20px; transform: translateX(-50%) scale(0); z-index: 3; padding: 4px 16px; border-radius: 999px;
  background: var(--ink); color: var(--yellow); font-family: var(--chunky); font-size: 18px; letter-spacing: .1em; white-space: nowrap; border: 3px solid var(--yellow);
}
body.reach .reach-tag { animation: reach-blink .3s steps(2) infinite; }
@keyframes reach-blink { 50% { color: #fff; border-color: var(--pink); } }
body.reach .cell.input.active { outline: 4px solid var(--yellow); background: #fff3b8; animation: reach-cell .25s steps(2) infinite; box-shadow: 0 0 0 6px var(--pink), 0 0 24px 8px rgba(255, 210, 63, .9); z-index: 2; }
@keyframes reach-cell { 50% { box-shadow: 0 0 0 6px var(--blue), 0 0 30px 12px rgba(255, 122, 182, .9); } }
body.reach .card { z-index: 3; }

.marquee { position: absolute; inset: -9px; border-radius: 30px; pointer-events: none; opacity: 0; transition: opacity .6s; padding: 5px;
  background: radial-gradient(circle, #fff 0 2.5px, var(--yellow) 3px 4.5px, transparent 5px) 0 0 / 16px 16px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: marquee .5s linear infinite; }
body.lv6 .marquee { opacity: 1; }
body.lv8 .marquee { background: radial-gradient(circle, #fff 0 2.5px, var(--pink) 3px 4.5px, transparent 5px) 0 0 / 16px 16px, radial-gradient(circle, #fff 0 2.5px, var(--yellow) 3px 4.5px, transparent 5px) 8px 8px / 16px 16px; }
@keyframes marquee { to { background-position: 16px 0, 24px 8px; } }
body.lv9 .card { box-shadow: 0 7px 0 var(--ink), 0 0 0 5px var(--pink), 0 0 40px 10px rgba(255, 210, 63, calc(.4 + var(--kick) * .6)); }

.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding: 0 14px; }
.pad button {
  position: relative; height: clamp(50px, 7.4dvh, 62px); border: 3px solid var(--ink); border-radius: 18px; background: #fff;
  font-family: var(--round); font-weight: 900; font-size: 30px; box-shadow: 0 5px 0 var(--ink);
  transform: translateY(calc(var(--kick) * -2px * var(--bounce, 0)));
}
.pad button.zero { grid-column: span 2; }
.pad button.del { background: var(--pink-soft); font-size: 24px; }
.pad button.press { transform: translateY(4px) scale(.97); box-shadow: 0 1px 0 var(--ink); }
body.lv4 .pad button { --bounce: 1; }
body.lv4 .pad button[data-key="7"], body.lv4 .pad button[data-key="3"] { background: #ffe3ef; }
body.lv4 .pad button[data-key="8"], body.lv4 .pad button[data-key="4"] { background: #fff4c7; }
body.lv4 .pad button[data-key="9"], body.lv4 .pad button[data-key="5"], body.lv4 .pad button[data-key="1"] { background: #e3ebff; }
body.lv4 .pad button[data-key="6"], body.lv4 .pad button[data-key="2"], body.lv4 .pad button[data-key="0"] { background: #dcfaef; }
body.lv8 .pad button { box-shadow: 0 5px 0 var(--ink), 0 0 calc(var(--kick) * 18px) rgba(255, 210, 63, .9); }
.pad button:disabled { opacity: .5; }

/* ------------------------------------------------------------ results */
#screen-result, #screen-final { align-items: safe center; justify-content: center; padding: 20px 16px; overflow-y: auto; }
#screen-result .result-card, #screen-final .result-card { margin: auto 0; flex: none; }
.actions .review-btn { font-size: 16px; white-space: nowrap; padding: 0 16px; }
.result-card {
  width: 100%; padding: 22px 20px 20px; text-align: center; background: #fff; border: 3.5px solid var(--ink); border-radius: 28px; box-shadow: 0 9px 0 var(--ink);
}
.score { margin: 8px 0 0; font-family: var(--chunky); line-height: 1; }
.score b { font-weight: 400; font-size: 92px; color: var(--pink); text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink), 0 8px 0 var(--ink); }
.score span { font-size: 28px; margin-left: 4px; font-family: var(--round); font-weight: 900; }
.completion-score { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.completion-score > small { font: 900 16px var(--round); }
.completion-score b { font-size: 48px; text-shadow: 2px 0 var(--ink), -2px 0 var(--ink), 0 2px var(--ink), 0 -2px var(--ink), 0 4px var(--ink); }
.completion-score span { font-size: 20px; }
#r-rate { color: var(--pink); }
.stats dd small { font-family: var(--round); font-weight: 900; font-size: 14px; margin-left: 2px; }
.breakdown { margin: 8px 0 0; font-size: 15px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 10px; }
.stats div { padding: 8px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--paper); }
.stats dt { font-size: 12px; opacity: .7; }
.stats dd { margin: 2px 0 0; font-family: var(--chunky); font-size: 22px; }
.dopa-final { margin: 6px 0 0; color: #8a8cb0; }
.dopa-final small { font-size: 12px; font-weight: 700; margin-right: 6px; }
.dopa-final b { font-family: var(--chunky); font-weight: 400; font-size: 15px; color: #6b6f9e; }
.unlock { min-height: 20px; font-size: 14px; margin: 10px 0 12px; }
.unlock.yes { color: var(--pink); }
.actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 8px; }

/* ------------------------------------------------------------ cut-ins */
.cutin-band { position: absolute; left: -20%; width: 140%; display: flex; align-items: center; justify-content: center; transform-origin: center; }
.cutin-band .band-bg { position: absolute; inset: 0; border-top: 4px solid var(--ink); border-bottom: 4px solid var(--ink);
  background: repeating-linear-gradient(-45deg, var(--c1) 0 22px, var(--c2) 22px 44px); }
.cutin-band .band-text { position: relative; font-family: var(--chunky); color: #fff; font-size: 44px; letter-spacing: .08em; white-space: nowrap;
  text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink), 0 7px 0 var(--ink); }
.unit-slam { position: absolute; font-family: var(--chunky); color: var(--yellow); white-space: nowrap; transform-origin: center;
  text-shadow: 4px 0 0 var(--ink), -4px 0 0 var(--ink), 0 4px 0 var(--ink), 0 -4px 0 var(--ink), 3px 3px 0 var(--ink), -3px 3px 0 var(--ink), 3px -3px 0 var(--ink), -3px -3px 0 var(--ink), 0 10px 0 var(--pink); }
.big-stamp { position: absolute; font-family: var(--chunky); color: var(--red); white-space: nowrap; transform-origin: center; }

body.reduced .logo span, body.reduced .spot, body.reduced .marquee, body.reduced .pip.now, body.reduced .cell.input.active { animation: none !important; }
@media (max-height: 840px) {
  /* Include toolbar-reduced phone heights and leave room for the bottom safe area. */
  .sheet-wrap { min-height: clamp(96px, calc(100dvh - 490px - env(safe-area-inset-bottom)), 176px); }
  #screen-play .card { padding-block: 8px; margin-bottom: 10px; }
  .pad { gap: 6px; }
  .pad button { height: 48px; }
  .stage { min-height: 80px; }
}
@media (max-height: 600px) {
  .stage { min-height: 48px; }
  .step-label { font-size: 12px; }
}

/* ------------------------------------------------------------ calendar */
.cal-card { width: 100%; max-width: 420px; padding: 12px 12px 14px; border: 3px solid var(--ink); border-radius: 22px; background: #fff; box-shadow: 0 6px 0 var(--ink); }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head h2 { margin: 0; font-family: var(--chunky); font-weight: 400; font-size: 20px; }
.cal-nav { width: 40px; height: 40px; border: 2.5px solid var(--ink); border-radius: 50%; background: var(--paper); font-size: 24px; line-height: 1; font-weight: 900; }
.cal-nav:disabled { opacity: .3; }
.cal-streak { margin: 4px 0 6px; min-height: 1.2em; text-align: center; font-size: 14px; font-weight: 900; color: var(--pink); }
.cal-streak b { font-family: var(--chunky); font-weight: 400; font-size: 20px; margin: 0 2px; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-week span { text-align: center; font-size: 11px; font-weight: 900; opacity: .6; }
.cal-week span:first-child { color: var(--red); }
.cal-week span:last-child { color: var(--blue); }
.cal-day { position: relative; aspect-ratio: 1 / 1.08; min-height: 40px; padding: 0; border: 0; border-radius: 10px; background: var(--paper); font-size: 11px; font-weight: 900; color: var(--ink); }
.cal-day .n { position: absolute; left: 4px; top: 2px; opacity: .55; }
.cal-day.blank { background: transparent; }
.cal-day.today { box-shadow: inset 0 0 0 2.5px var(--blue); }
.cal-day.played { background: #fff0f6; cursor: pointer; }
.cal-day.played svg { position: absolute; inset: 8% 6% 2%; width: 88%; height: 90%; }
.cal-day .sc { position: absolute; left: 0; right: 0; bottom: 18%; text-align: center; font-family: var(--chunky); font-weight: 400; font-size: 12px; color: var(--red); letter-spacing: -.03em; text-shadow: 1.5px 0 0 #fff, -1.5px 0 0 #fff, 0 1.5px 0 #fff, 0 -1.5px 0 #fff; }
.cal-day .sc.big { font-size: 10px; }
.cal-day.pop { animation: cal-pop .7s cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes cal-pop { 0% { transform: scale(0) rotate(-30deg); } 100% { transform: scale(1) rotate(0); } }
.day-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.day-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px; padding: 8px 12px; border: 2.5px solid var(--ink); border-radius: 14px; background: #fff; font-size: 13px; }
.day-list .t { font-weight: 900; opacity: .6; }
.day-list .m { font-weight: 900; }
.day-list .s { font-family: var(--chunky); font-weight: 400; font-size: 20px; color: var(--red); grid-row: span 2; }
.day-list .d { grid-column: 1 / 3; font-size: 12px; opacity: .75; }

/* ------------------------------------------------------------ expression layouts */
.cell.word { font-size: calc(var(--ch) * .46); white-space: nowrap; color: #4a4f86; }
.sheet.h .cell.op { font-size: calc(var(--ch) * .62); }
.cell.dot { justify-self: end; align-self: end; width: 0; overflow: visible; font-size: calc(var(--ch) * .82); line-height: .9; color: var(--ink); pointer-events: none; z-index: 1; display: flex; justify-content: center; }
.cell.dot.hidden { visibility: hidden; }
.cell.frac-n { align-self: end; }
.cell.frac-d { align-self: start; }
.cell.input.frac-n, .cell.input.frac-d { margin: 2px 3px; }
.hline.fbar { margin: 0 4px -2px; }

/* ------------------------------------------------------------ modes */
.level-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 78px; gap: 2px; background: var(--pink); }
.level-btn small { font-size: 13px; letter-spacing: 0; }
.grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(100%, 340px); }
.grades button { height: 52px; border: 3px solid var(--ink); border-radius: 16px; background: #fff; font-family: var(--chunky); font-size: 24px; box-shadow: 0 4px 0 var(--ink); }
.grades button small { font-family: var(--round); font-weight: 900; font-size: 12px; margin-left: 2px; }
.grades button:nth-child(6n+1) { background: #ffe3ef; } .grades button:nth-child(6n+2) { background: #e3ebff; } .grades button:nth-child(6n+3) { background: #fff4c4; }
.grades button:nth-child(6n+4) { background: #d9fbef; } .grades button:nth-child(6n+5) { background: #efe6ff; } .grades button:nth-child(6n+6) { background: #ffe6dc; }
.grades button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.mode-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.mode-row .sub-btn { min-width: 150px; font-weight: 900; }
.mode-row .sub-btn b, .review-btn b { font-family: var(--chunky); font-weight: 400; color: var(--pink); margin-left: 4px; }
.review-btn { background: #fff4c4; }

/* ------------------------------------------------------------ skill tree */
#screen-tree { flex-direction: column; padding: calc(10px + env(safe-area-inset-top)) 0 0; }
.tree-head { display: flex; align-items: center; gap: 10px; padding: 0 14px 6px; }
.tree-head h2 { margin: 0; flex: 1; font-family: var(--chunky); font-weight: 400; font-size: 22px; }
.tree-head .icon-btn { font-size: 26px; font-weight: 900; line-height: 1; }
.tree-count { font-family: var(--chunky); font-size: 16px; padding: 4px 10px; border: 2.5px solid var(--ink); border-radius: 999px; background: #fff; }
.tree-lanes { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 3px 4px; background: var(--paper); box-sizing: border-box; }
.tree-lanes span { text-align: center; font-size: 11px; font-weight: 900; padding: 3px 0; border-radius: 999px; background: var(--ink); color: #fff; }
.tree-scroll { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 0 6px calc(40px + env(safe-area-inset-bottom)); }
.tree { position: relative; }
.tree-links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tree-links path { fill: none; stroke: #c9cbe8; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.tree-links path.on { stroke: var(--ink); }
.tree-links path.grow { stroke: var(--pink); stroke-width: 5; }
.node { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 3px 3px; border: 2.5px solid var(--ink); border-radius: 14px; background: #fff; box-shadow: 0 3px 0 var(--ink); font-size: 10.5px; font-weight: 900; line-height: 1.15; text-align: center; color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; }
.node .g { font-size: 9px; opacity: .6; }
.node .ring { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 4px; border-radius: 3px; background: linear-gradient(90deg, var(--pink) calc(var(--p) * 100%), #eee calc(var(--p) * 100%)); }
.node.locked { background: #eceaf3; color: #8a8cb0; border-color: #a9abc9; box-shadow: 0 3px 0 #a9abc9; }
.node.locked::before { content: ""; position: absolute; top: -8px; right: -6px; width: 16px; height: 13px; border-radius: 3px; background: #a9abc9; box-shadow: inset 0 0 0 2px #8a8cb0; }
.node.locked::after { content: ""; position: absolute; top: -15px; right: -2px; width: 8px; height: 9px; border: 2.5px solid #8a8cb0; border-bottom: 0; border-radius: 6px 6px 0 0; }
.node.new { background: #fff4c4; animation: node-new 1.1s ease-in-out infinite; }
.node.new::after { content: "NEW"; position: absolute; top: -10px; right: -8px; padding: 1px 5px; border-radius: 999px; background: var(--pink); color: #fff; font-family: var(--chunky); font-weight: 400; font-size: 10px; border: 2px solid var(--ink); }
.node.learning { background: #e3ebff; }
.node.mastered { background: linear-gradient(160deg, #fff6c8, #ffd23f); }
.node.mastered::after { content: "★"; position: absolute; top: -12px; right: -6px; font-size: 20px; color: #ffb000; -webkit-text-stroke: 1.5px var(--ink); }
.node.just { animation: node-pop .8s cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes node-new { 50% { transform: translateY(-3px); } }
@keyframes node-pop { 0% { transform: scale(0) rotate(-20deg); } 100% { transform: scale(1); } }
body.reduced .node { animation: none !important; }
/* Long press to erase (id031): a pink fill rises while held. */
.node { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; overflow: visible; }
.node .hold { position: absolute; inset: 0; border-radius: 11px; background: rgba(255, 79, 109, .35); transform-origin: bottom; transform: scaleY(0); pointer-events: none; }
.node.holding .hold { transform: scaleY(1); transition: transform var(--hold-ms, 600ms) linear; }
.node.holding { transform: scale(.94); transition: transform .12s; }
.node.erased { animation: node-erase .6s ease-out both; }
@keyframes node-erase { 0% { transform: scale(1.12) rotate(4deg); filter: brightness(1.4); } 40% { transform: scale(.9) rotate(-3deg); } 100% { transform: none; } }
.tree-note { margin: 0 0 4px; text-align: center; font-size: 11px; font-weight: 900; opacity: .6; }
.confirm-msg { margin: 0; word-break: keep-all; overflow-wrap: anywhere; font-size: 15px; font-weight: 900; line-height: 1.6; text-align: center; }
.confirm-msg b { color: var(--red); }
.confirm-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.confirm-list li { padding: 3px 9px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 900; }
.confirm-list li.more { border-style: dashed; background: transparent; }
.confirm-actions { display: flex; justify-content: center; gap: 12px; }
.confirm-actions .sub-btn { min-width: 120px; font-weight: 900; }
.sub-btn.danger { background: var(--red); color: #fff; text-shadow: 0 2px 0 rgba(27, 29, 77, .45); }
.toast { position: absolute; left: 16px; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); margin: 0; padding: 10px 14px; border: 3px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 0 5px 0 var(--ink); font-weight: 900; font-size: 14px; text-align: center; z-index: 3; pointer-events: none; }
.skill-news { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.skill-news:empty { display: none; }
.skill-news p { margin: 0; padding: 6px 10px; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff4c4; font-size: 13px; font-weight: 900; text-align: center; }
.skill-news p.mastered { background: linear-gradient(160deg, #fff6c8, #ffd23f); }

/* ------------------------------------------------------------ demo play */
.demo-btn { align-self: center; min-width: 230px; font-weight: 900; background: #e3ebff; }
.demo-tag { display: none; padding: 3px 10px; border-radius: 999px; background: var(--red); color: #fff; font-family: var(--chunky); font-size: 13px; letter-spacing: .08em; border: 2.5px solid var(--ink); animation: demo-blink 1.2s steps(2) infinite; }
body.demo .demo-tag { display: inline-block; }
@keyframes demo-blink { 50% { opacity: .45; } }
body.reduced .demo-tag { animation: none; }

/* ------------------------------------------------------------ streak & login bonus */
.cal-badges { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 8px; min-height: 30px; }
.cal-badge { display: inline-flex; align-items: baseline; gap: 3px; padding: 3px 12px; border: 2.5px solid var(--ink); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 900; }
.cal-badge b { font-family: var(--chunky); font-weight: 400; font-size: 20px; color: var(--pink); }
.cal-badge.hot { background: linear-gradient(90deg, #ffd23f, #ff9a3c); }
.cal-badge.hot b { color: var(--ink); }
.cal-badge.best b { color: var(--blue); }
.cal-badge.stk b { color: #ffb000; }
.cal-day .stk { position: absolute; top: 1px; right: 1px; width: 44%; height: 44%; pointer-events: none; }
.cal-day .stk svg { position: static; width: 100%; height: 100%; inset: auto; }
.bonus-card { align-items: center; text-align: center; }
.bonus-run { margin: 0; font-weight: 900; font-size: 15px; }
.bonus-run b { font-family: var(--chunky); font-weight: 400; font-size: 30px; color: var(--pink); margin: 0 4px; }
.bonus-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; }
.bonus-slot { position: relative; min-width: 0; aspect-ratio: 1; overflow: hidden; display: grid; place-items: center; border: 2.5px dashed #b9bbd8; border-radius: 16px; background: #fff; font-family: var(--chunky); font-size: 18px; color: #c4c6de; }
.bonus-slot.got { border-style: solid; border-color: var(--ink); background: #fff4c4; }
.bonus-slot.today { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255, 122, 182, .35); }
.bonus-slot.big { background: linear-gradient(160deg, #fff6c8, #ffd23f); color: var(--ink); border-style: solid; border-color: #ffb000; }
.bonus-slot .d { position: absolute; left: 6px; top: 3px; font-size: 11px; color: #8a8cb0; font-family: var(--round); font-weight: 900; }
.bonus-slot svg { display: block; width: 72%; height: 72%; }
.bonus-slot.big svg { width: 86%; height: 86%; }
.bonus-slot.stamping svg { animation: stamp-in .6s cubic-bezier(.3, 1.8, .5, 1) both .35s; }
@keyframes stamp-in { 0% { transform: scale(2.6) rotate(-25deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(0); } }
body.reduced .bonus-slot.stamping svg { animation: none; }
.bonus-note { margin: 0; font-size: 13px; font-weight: 900; opacity: .75; }

/* ------------------------------------------------------------ no-count hammer (id034) */
.hammer-card { align-items: center; text-align: center; }
.hammer-art { width: 110px; height: 110px; transform: rotate(-24deg); filter: drop-shadow(0 5px 0 rgba(27, 29, 77, .85)); }
.hammer-art svg { width: 100%; height: 100%; }
.hammer-msg { margin: 0; font-size: 16px; font-weight: 900; line-height: 1.7; word-break: keep-all; }
.hammer-msg b { font-family: var(--chunky); font-weight: 400; color: var(--pink); font-size: 1.25em; margin: 0 2px; }
.hammer-have { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 0; font-size: 13px; font-weight: 900; }
.hammer-have i { display: inline-block; width: 30px; height: 30px; opacity: .22; filter: grayscale(1); }
.hammer-have i.on { opacity: 1; filter: none; }
.hammer-have svg, .cal-badge.hmr svg { width: 100%; height: 100%; display: block; }
.sub-btn.hammer-yes { background: var(--pink); color: #fff; text-shadow: 0 2px 0 rgba(27, 29, 77, .45); }
.cal-badge.hmr { align-items: center; }
.cal-badge.hmr i { width: 22px; height: 22px; margin-right: 2px; transform: rotate(-20deg); }
.cal-badge.hmr b { color: var(--blue); }
.cal-day.nocount { background: #efe8ff; }
.cal-day .nc { position: absolute; left: 50%; top: 56%; transform: translate(-50%, -50%) rotate(-14deg); padding: 1px 3px; border: 2px solid #7a4bff; border-radius: 5px; color: #7a4bff; font-size: 9px; font-weight: 900; letter-spacing: -.04em; white-space: nowrap; background: rgba(255, 255, 255, .7); }
.cal-day.stamped .nc { animation: nc-stamp .5s cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes nc-stamp { 0% { transform: translate(-50%, -50%) rotate(-30deg) scale(2.6); opacity: 0; } 100% { transform: translate(-50%, -50%) rotate(-14deg) scale(1); opacity: 1; } }
.hammer-fx { position: absolute; width: 100px; height: 100px; transform-origin: 50px 94px; filter: drop-shadow(0 4px 0 rgba(27, 29, 77, .8)); }
.hammer-fx svg { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------ daily quests (id035) */
.quest-card { width: 100%; max-width: 420px; padding: 10px 12px 12px; border: 3px solid var(--ink); border-radius: 22px; background: #fff; box-shadow: 0 6px 0 var(--ink); }
.quest-card.complete { background: linear-gradient(160deg, #fffbe6, #fff2b8); }
.quest-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.quest-head h2 { margin: 0; font-family: var(--chunky); font-weight: 400; font-size: 18px; }
.quest-reward, .qm-head span { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.qham { display: inline-block; width: 22px; height: 22px; transform: rotate(-20deg); vertical-align: middle; }
.qham svg { width: 100%; height: 100%; display: block; }
.qdone { color: var(--pink); font-family: var(--chunky); font-weight: 400; font-size: 15px; }
.quest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.quest-list li { position: relative; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 6px 10px 9px 6px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--paper); font-size: 14px; font-weight: 900; overflow: hidden; }
.quest-list li.done { background: #dff8ec; }
.quest-list li.go { cursor: pointer; background: #fff4c4; box-shadow: 0 3px 0 var(--ink); }
.quest-list li.go::after { content: "▶"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10px; opacity: .55; }
.quest-list li.go .qp { margin-right: 12px; }
.qchk { width: 24px; height: 24px; border: 2.5px solid var(--ink); border-radius: 50%; background: #fff; color: #fff; display: grid; place-items: center; }
.qchk svg { width: 17px; height: 17px; }
li.done .qchk { background: var(--mint); }
.qt { word-break: keep-all; overflow-wrap: anywhere; line-height: 1.3; }
.qp { font-family: var(--chunky); font-weight: 400; font-size: 14px; color: var(--blue); }
li.done .qp { color: #1f9e76; }
.qbar { position: absolute; left: 8px; right: 8px; bottom: 3px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--pink) calc(var(--p) * 100%), rgba(27, 29, 77, .12) calc(var(--p) * 100%)); }
li.done .qbar { background: var(--mint); }
.quest-mini { width: 100%; margin: 4px 0 10px; text-align: left; }
.quest-mini:empty { display: none; }
.qm-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 5px; font-size: 13px; font-weight: 900; }
.quest-mini .quest-list li { font-size: 12.5px; padding: 4px 8px 7px 5px; grid-template-columns: 22px 1fr auto; }
.quest-mini .qchk { width: 20px; height: 20px; }
.qm-got { margin: 8px 0 0; padding: 6px 10px; border: 2.5px solid var(--ink); border-radius: 12px; background: linear-gradient(160deg, #fff6c8, #ffd23f); font-size: 13px; font-weight: 900; text-align: center; }
.quest-pop { position: absolute; left: 50%; display: flex; flex-direction: column; align-items: center; padding: 6px 16px 7px; border: 3px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 0 5px 0 var(--ink); font-size: 13px; font-weight: 900; white-space: nowrap; transform: translate(-50%, 0); opacity: 0; }
.quest-pop b { font-family: var(--chunky); font-weight: 400; font-size: 16px; color: var(--pink); }
.quest-pop.all { background: linear-gradient(160deg, #fff6c8, #ffd23f); }
.quest-pop.all b { color: var(--ink); font-size: 20px; }
.cal-day .qd { position: absolute; left: 2px; bottom: 1px; width: 15px; height: 15px; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--yellow); color: #fff; font-size: 9px; line-height: 12px; text-align: center; -webkit-text-stroke: .6px var(--ink); }

/* ------------------------------------------------------------ trophies (id036) */
.trophy-card { align-items: center; text-align: center; gap: 10px; overflow: hidden; }
.tg-sub { margin: 0; font-size: 15px; font-weight: 900; }
.tg-sub:empty { display: none; }
.tg-sub b { font-family: var(--chunky); font-weight: 400; font-size: 24px; color: var(--pink); margin: 0 2px; }
/* two compact columns; the list scrolls inside the card so the button stays in view */
.tg-list { list-style: none; margin: 0; padding: 2px; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.tg-list li { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 8px; min-width: 0; padding: 4px 8px 4px 5px; border: 2.5px solid var(--ink); border-radius: 13px; background: #fff; text-align: left; transition: opacity .15s; }
.tg-list li:only-child { grid-column: 1 / -1; }
.tg-list li i { width: 34px; height: 34px; }
.tg-list li svg, .tr-icon svg, .tr-series li i svg { width: 100%; height: 100%; display: block; }
.tg-list li b { display: block; font-size: 13.5px; font-weight: 900; line-height: 1.25; }
.tg-list li small { display: block; font-size: 10.5px; opacity: .72; line-height: 1.3; }
.tg-list li.r-gold { background: #fff6cf; } .tg-list li.r-rainbow { background: linear-gradient(120deg, #ffe3ef, #fff4c4, #dcfaef, #e3ebff); } .tg-list li.r-secret { background: #efe6ff; }
.tg-list li.more { display: block; grid-column: 1 / -1; padding: 3px 8px; text-align: center; border-style: dashed; font-size: 12.5px; font-weight: 900; }
.tg-list li.sec { display: block; grid-column: 1 / -1; padding: 6px 0 0; border: 0; background: none; text-align: center; font-size: 12.5px; font-weight: 900; color: #6b6f9e; }
@media (min-width: 700px) { .trophy-card { width: min(100%, 660px); } .tg-list { grid-template-columns: repeat(3, 1fr); } }
#screen-trophy { flex-direction: column; padding: calc(10px + env(safe-area-inset-top)) 0 0; }
.tr-filter { display: flex; justify-content: center; gap: 8px; padding: 0 14px 8px; }
.tr-filter button { height: 34px; padding: 0 14px; border: 2.5px solid var(--ink); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 900; }
.tr-filter button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.tr-scroll { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 0 14px calc(40px + env(safe-area-inset-bottom)); }
.tr-cat { margin: 14px 0 6px; font-family: var(--chunky); font-weight: 400; font-size: 16px; }
.tr-cat:first-child { margin-top: 2px; }
.tr-series { margin-bottom: 8px; border: 2.5px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 0 3px 0 var(--ink); overflow: hidden; }
.tr-series summary { list-style: none; display: grid; grid-template-columns: 40px 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px; padding: 7px 12px 8px 7px; cursor: pointer; }
.tr-series summary::-webkit-details-marker { display: none; }
.tr-icon { grid-row: span 2; width: 40px; height: 40px; }
.tr-t { display: flex; flex-direction: column; min-width: 0; }
.tr-t b { font-size: 14px; font-weight: 900; }
.tr-next { font-size: 11.5px; opacity: .75; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.35; }
.tr-next.done { color: var(--pink); opacity: 1; font-weight: 900; }
.tr-n { font-family: var(--chunky); font-size: 15px; color: var(--blue); }
.tr-dots { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.tr-dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #b9bbd8; background: #fff; }
.tr-dots i.on { border-color: var(--ink); background: #eea36b; }
.tr-dots i.on.r-silver { background: #dde3ee; } .tr-dots i.on.r-gold { background: var(--yellow); } .tr-dots i.on.r-rainbow { background: conic-gradient(#ff7ab6, #ffd23f, #3fdcb0, #3b6bff, #ff7ab6); } .tr-dots i.on.r-secret { background: var(--violet); }
.tr-series[open] summary { border-bottom: 2px dashed #c9cbe8; }
.tr-series ul { list-style: none; margin: 0; padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 4px; }
.tr-series li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 10px; font-size: 12px; }
.tr-series li i { width: 30px; height: 30px; }
.tr-series li b { display: block; font-weight: 900; }
.tr-series li small { display: block; font-size: 10.5px; opacity: .7; }
.tr-series li:not(.got) { opacity: .6; }
.tr-series li.got { background: #fffbe6; }
.tr-series li em { font-style: normal; font-size: 11px; font-weight: 900; color: var(--blue); }
.tr-empty { text-align: center; font-weight: 900; opacity: .6; }

/* ------------------------------------------------------------ skill stars (id037) */
.star-row path { fill: #fff; stroke: #b9bbd8; stroke-width: 1.8; stroke-linejoin: round; }
.star-row path.on { fill: var(--yellow); stroke: var(--ink); }
.node.mastered::after { content: none; }
.node .stars { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); display: block; width: 50px; height: 11px; padding: 1px 3px; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; line-height: 0; box-sizing: content-box; }
.node .stars .star-row { width: 100%; height: 100%; }
.node .stars.s5 { background: linear-gradient(90deg, #ffe3ef, #fff4c4, #dcfaef, #e3ebff); }
.node.star-up .stars { animation: star-pop .8s cubic-bezier(.3, 1.8, .5, 1) both .3s; }
@keyframes star-pop { 0% { transform: translateX(-50%) scale(.2); } 100% { transform: translateX(-50%) scale(1); } }
.tree { padding-top: 6px; }
.tree-stars { display: flex; align-items: center; justify-content: center; gap: 4px; margin: -2px 0 2px; font-size: 12px; font-weight: 900; }
.tree-stars .star-row { width: 16px; height: 16px; }
@media (max-width: 520px) { .tree-stars { display: block; padding: 0 14px; text-align: center; font-size: 11px; text-wrap: balance; } }
.tree-stars b { font-family: var(--chunky); font-weight: 400; font-size: 16px; color: #d99400; }
.skill-news p.star-up { display: flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(90deg, #fff6c8, #ffe3ef); }
.skill-news p.star-up .star-row { width: 70px; height: 14px; flex: none; }
.si-card { align-items: center; text-align: center; gap: 10px; }
.si-grade { margin: 0; font-size: 12px; font-weight: 900; opacity: .65; }
.si-title { margin: 0; font-family: var(--chunky); font-weight: 400; font-size: 24px; line-height: 1.2; word-break: keep-all; overflow-wrap: anywhere; }
.si-stars { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; font-weight: 900; font-size: 13px; }
.si-stars .star-row { width: 190px; height: 38px; }
.si-next { width: 100%; padding: 10px 12px; border: 2.5px dashed var(--ink); border-radius: 16px; background: #fff; }
.si-next p { margin: 0; }
.si-label { font-family: var(--chunky); font-size: 15px; color: #d99400; }
.si-text { font-size: 15px; font-weight: 900; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.si-text.done { color: var(--pink); }
.si-now { margin-top: 4px !important; font-size: 13px; font-weight: 900; color: var(--blue); }
.si-note { margin: 0; font-size: 12px; font-weight: 900; opacity: .7; }
.sub-btn.si-go { background: var(--blue); color: #fff; text-shadow: 0 2px 0 rgba(27, 29, 77, .45); }

/* ------------------------------------------------------------ compared with before (id038) */
.growth-box { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0; padding: 8px 10px 10px; border: 2.5px solid var(--ink); border-radius: 16px; background: linear-gradient(160deg, #e3ebff, #dcfaef); }
.growth-box:empty { display: none; }
.gb-head { margin: 0; font-family: var(--chunky); font-weight: 400; font-size: 18px; color: var(--blue); }
.gb-line { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 6px; border-radius: 12px; background: #fff; }
.gb-line > b { font-size: 13px; font-weight: 900; }
.gb-row { display: flex; align-items: flex-end; justify-content: center; gap: 8px; }
.gb-what { font-size: 11px; font-weight: 900; opacity: .7; padding-bottom: 3px; }
.gb-old, .gb-new { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.gb-old small, .gb-new small { font-size: 10px; font-weight: 900; opacity: .6; }
.gb-old { font-size: 14px; font-weight: 900; color: #8a8cb0; }
.gb-arrow { font-weight: 900; color: var(--pink); padding-bottom: 2px; }
.gb-new em { font-style: normal; font-family: var(--chunky); font-size: 22px; color: var(--pink); display: inline-block; }
/* The result screens grew (growth, quests): keep the next actions on screen (id038). */
.result-card .actions { position: sticky; bottom: -20px; z-index: 2; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px -20px -20px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 2.5px dashed #c9cbe8; border-radius: 0 0 25px 25px; background: #fff; }
.result-card .actions .big-btn { flex: 1 0 100%; max-width: 360px; height: 62px; }
.result-card .actions .sub-btn { flex: 1 1 auto; min-width: 0; height: 46px; padding: 0 12px; font-size: 15px; }
.result-card .actions .sub-btn[hidden] { display: none; }

/* ------------------------------------------------------------ time capsule (id039) */
.card.capsule { background: #fffaf0; box-shadow: 0 7px 0 var(--ink), 0 0 0 5px #ffb86b; }
.capsule-intro { position: absolute; width: 0; height: 0; }
.ci-env { position: absolute; left: 0; top: 0; width: 230px; transform: translate(-50%, -50%); opacity: 0; filter: drop-shadow(0 6px 0 rgba(27, 29, 77, .85)); }
.ci-env svg { width: 100%; display: block; overflow: visible; }
.env-flap { transform-origin: 110px 40px; transform-box: view-box; }
.ci-letter { position: absolute; left: 50%; top: 50%; width: 190px; padding: 10px 8px 12px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; text-align: center; transform: translate(-50%, -50%) scale(.8); opacity: 0; z-index: 1; }
.ci-letter small { display: block; font-size: 11px; font-weight: 900; color: #e08a2a; letter-spacing: .1em; }
.ci-letter b { display: block; font-family: var(--chunky); font-weight: 400; font-size: 20px; }
.ci-letter span { display: block; font-size: 11px; font-weight: 900; opacity: .7; }
.capsule-result { position: absolute; display: flex; flex-direction: column; align-items: center; padding: 8px 16px 10px; border: 3px solid var(--ink); border-radius: 18px; background: #fffaf0; box-shadow: 0 5px 0 var(--ink), 0 0 0 4px #ffb86b; transform: translate(-50%, 0); opacity: 0; white-space: nowrap; }
.capsule-result small { font-size: 11px; font-weight: 900; color: #e08a2a; letter-spacing: .1em; }
.capsule-result b { font-family: var(--chunky); font-weight: 400; font-size: 20px; }
.capsule-result > span { font-size: 13px; font-weight: 900; }
.cr-row { display: flex; align-items: flex-end; gap: 10px; }
.cr-old, .cr-new { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.cr-old i, .cr-new i { font-style: normal; font-size: 10px; font-weight: 900; opacity: .6; }
.cr-old { font-size: 16px; font-weight: 900; color: #8a8cb0; }
.cr-new { font-family: var(--chunky); font-size: 26px; color: var(--pink); }
.cr-arrow { font-weight: 900; color: #e08a2a; padding-bottom: 4px; }
.skill-news p.capsule-news { background: #fffaf0; box-shadow: inset 0 0 0 2px #ffb86b; }
.skill-news p.capsule-news b { margin-right: 8px; color: #e08a2a; }
.cr-new i, .gb-new small { font-family: var(--round); line-height: 1.3; margin-bottom: 1px; }
.cr-new, .gb-new em { line-height: 1; }
/* id050: review sits right under じぶんレベル. */
.modes > .review-main { min-width: 240px; font-weight: 900; }
.modes > .review-main[hidden] { display: none; }
/* 今日复习: mint, with a one-line note under the label (beside it on wide screens) */
.modes > .daily-btn { min-width: 240px; height: auto; min-height: 52px; padding: 5px 20px 7px; font-weight: 900; background: linear-gradient(180deg, #f3fffa, #d4f6e7); }
.modes > .daily-btn[hidden] { display: none; }
.daily-btn b { font-family: var(--chunky); font-weight: 400; color: #10a079; margin-left: 4px; }
.daily-btn small { display: block; font-size: 11px; font-weight: 900; color: #5b7f73; letter-spacing: 0; }

/* ------------------------------------------------------------ rust (id040) */
.node.rusty { background: linear-gradient(160deg, #fff1cc, #e7c88a); }
.node.rusty::before { content: ""; position: absolute; inset: 3px; border-radius: 11px; pointer-events: none;
  background: radial-gradient(circle at 18% 26%, rgba(168, 98, 40, .45) 0 3px, transparent 3.5px), radial-gradient(circle at 78% 72%, rgba(168, 98, 40, .4) 0 4px, transparent 4.5px), radial-gradient(circle at 64% 20%, rgba(168, 98, 40, .35) 0 2px, transparent 2.5px), radial-gradient(circle at 30% 80%, rgba(168, 98, 40, .3) 0 2.5px, transparent 3px); }
.node .rust { position: absolute; top: -9px; left: -6px; padding: 0 4px; border: 1.5px solid var(--ink); border-radius: 6px; background: #c9772f; color: #fff; font-style: normal; font-size: 9px; line-height: 14px; transform: rotate(-10deg); }
.skill-news p.polish-news { background: linear-gradient(90deg, #fff, #fff6c8, #fff); }

/* ------------------------------------------------------------ collection (id041) */
#screen-collect { flex-direction: column; padding: calc(10px + env(safe-area-inset-top)) 0 0; }
.co-preview { position: relative; flex: none; height: min(28vh, 220px); margin: 0 14px 8px; border: 3px solid var(--ink); border-radius: 22px; background: rgba(255, 255, 255, .35); box-shadow: 0 5px 0 var(--ink); overflow: hidden; }
.co-preview .co-mark { left: 50%; top: 50%; right: auto !important; transform-origin: center; translate: -50% -58%; }
.co-now { position: absolute; left: 10px; top: 8px; margin: 0; padding: 2px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 900; }
.co-tabs { flex: none; display: flex; gap: 6px; overflow-x: auto; padding: 2px 14px 8px; scrollbar-width: none; }
.co-tabs::-webkit-scrollbar { display: none; }
.co-tabs button { flex: none; display: flex; flex-direction: column; align-items: center; padding: 4px 12px; border: 2.5px solid var(--ink); border-radius: 14px; background: #fff; font-size: 12px; font-weight: 900; line-height: 1.2; }
.co-tabs button small { font-size: 10px; opacity: .6; }
.co-tabs button[aria-pressed="true"] { background: var(--yellow); box-shadow: 0 3px 0 var(--ink); }
.co-scroll { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 0 14px calc(40px + env(safe-area-inset-bottom)); }
.co-note { margin: 0 0 8px; font-size: 12px; font-weight: 900; opacity: .7; text-align: center; }
.co-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.co-item { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 8px 4px 8px; border: 2.5px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 0 3px 0 var(--ink); }
.co-item.on { background: #fff4c4; box-shadow: 0 0 0 4px var(--pink), 0 3px 0 var(--ink); }
.co-item.locked { background: #eceaf3; color: #8a8cb0; border-color: #a9abc9; box-shadow: 0 3px 0 #a9abc9; }
.co-item.locked .co-th { filter: grayscale(1) brightness(.6) contrast(.6); opacity: .45; }
.co-th { display: grid; place-items: center; width: 64px; height: 64px; }
.co-th > svg, .co-th .th-crowd svg { width: 100%; height: 100%; display: block; }
.co-th b { font-family: var(--chunky); font-weight: 400; font-size: 34px; color: var(--pink); }
.co-item.auto .co-th { border: 2.5px dashed var(--ink); border-radius: 50%; width: 56px; height: 56px; margin: 4px; }
.th-bg { display: block; width: 58px; height: 58px; border: 2.5px solid var(--ink); border-radius: 14px; }
.th-music { display: grid; place-items: center; width: 58px; height: 58px; border: 2.5px solid var(--ink); border-radius: 50%; background: #fff; }
.th-music svg { width: 40px; height: 40px; }
.th-crowd { display: flex; width: 70px; height: 64px; align-items: flex-end; }
.th-crowd svg { width: 34% !important; height: auto !important; margin: 0 -2%; }
.co-name { font-size: 12.5px; font-weight: 900; word-break: keep-all; overflow-wrap: anywhere; text-align: center; line-height: 1.25; }
.co-item small { font-size: 9.5px; opacity: .75; text-align: center; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; }
.tg-list li.reward { background: linear-gradient(120deg, #fff4c4, #ffe3ef); border-style: dashed; }
.tg-list li.reward i { display: grid; place-items: center; overflow: hidden; }
.tg-list li.reward i > * { max-width: 34px; max-height: 34px; }
.tg-list li.reward .th-bg, .tg-list li.reward .th-music { width: 30px; height: 30px; }
.tr-series li small.rw { color: #d97a00; opacity: 1; }
.finale-rocket { position: absolute; left: 0; top: 0; width: 180px; height: 120px; transform-origin: 90px 60px; filter: drop-shadow(0 6px 0 rgba(27, 29, 77, .8)); }
.finale-rocket svg { width: 100%; height: 100%; }
.finale-banner { position: absolute; left: 0; top: 0; width: 180px; padding: 8px 0; border: 4px solid var(--ink); border-radius: 12px; background: #fff; color: var(--pink); font-family: var(--chunky); font-size: 30px; text-align: center; box-shadow: 0 6px 0 var(--ink); }
/* id045: "もうすぐ" — the closest next steps. */
.tr-soon { display: grid; grid-template-columns: 40px 1fr 56px; align-items: center; gap: 10px; margin-bottom: 8px; padding: 7px 10px 7px 7px; border: 2.5px solid var(--ink); border-radius: 16px; background: #fff; box-shadow: 0 3px 0 var(--ink); }
.tr-pct { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: conic-gradient(var(--pink) calc(var(--p) * 360deg), #eceaf3 0); }
.tr-pct b { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; font-family: var(--chunky); font-weight: 400; font-size: 12px; }
.tr-filter { flex-wrap: wrap; }

/* ------------------------------------------------------------ title guide (id052) */
.help-btn { top: calc(72px + env(safe-area-inset-top)); }
#guide { position: fixed; inset: 0; z-index: 10; touch-action: none; }
#guide[hidden] { display: none; }
.guide-shade, #guide-actor { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#guide-actor { overflow: visible; }
#guide-skip { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 16px; min-width: 90px; min-height: 44px; background: var(--paper); }
#guide-card { position: absolute; left: 50%; transform: translateX(-50%); width: min(360px, calc(100% - 32px)); padding: 16px; border: 3px solid var(--ink); border-radius: 22px 18px 24px 16px; box-shadow: 0 6px 0 var(--ink); background: var(--paper); text-align: center; }
#guide-heading { margin: 0 0 8px; font-size: 20px; line-height: 1.4; }
#guide-text { margin: 0; white-space: pre-line; font-size: 15px; line-height: 1.7; }
#guide-dots { display: flex; justify-content: center; gap: 9px; margin: 14px 0; }
#guide-dots i { width: 10px; height: 10px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; }
#guide-dots .current { background: var(--pink); transform: scale(1.25); }
.guide-actions { display: flex; gap: 12px; }
.guide-actions button { flex: 1; min-width: 0; height: 48px; font-size: 18px; padding: 0 8px; }
#guide-back:disabled { opacity: .4; cursor: default; }
#guide-books { display: grid; gap: 10px; margin-top: 14px; }
#guide-books[hidden] { display: none; }
#guide-books button { width: 100%; min-width: 0; height: 50px; font-family: var(--chunky); font-size: 20px; color: var(--ink); }
#guide-books:has(> :nth-child(5)) { grid-template-columns: 1fr 1fr; }
#guide-books:has(> :nth-child(9)) { grid-template-columns: repeat(3, 1fr); gap: 8px; }
#guide-books:has(> :nth-child(9)) button { height: 44px; padding: 0 4px; font-size: 16px; }
#guide-recommend { position: absolute; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 6px; background: var(--yellow); font-size: 13px; font-weight: 900; transform: rotate(-4deg); }
body.guide-open .logo *, body.guide-open .logo-burst { animation: none !important; }
@media (max-height: 680px) {
  #guide-card { padding: 12px; }
  #guide-heading { font-size: 18px; }
  #guide-text { font-size: 14px; }
  #guide-dots { margin: 12px 0; }
}
/* Keep the real help button clear of Skip when both targets fit. */
#guide.guide-last #guide-skip { left: 16px; right: auto; }
#guide-help-ring { animation: guide-help-pulse 1.4s ease-in-out infinite; }
.guide-help-icon { position: relative; display: inline-grid; place-items: center; vertical-align: middle; width: 32px; height: 32px; padding: 3px; margin: 4px 3px; background: #fff; box-shadow: 0 3px 0 var(--ink); cursor: default; }
.guide-help-icon svg { display: block; width: 100%; height: 100%; }
.guide-help-fallback::after { content: ''; position: absolute; inset: -5px; border: 2px solid var(--yellow); border-radius: 14px; animation: guide-help-pulse 1.4s ease-in-out infinite; }
@keyframes guide-help-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
body.reduced #guide-help-ring, body.reduced .guide-help-fallback::after { animation: none; }

/* ---------------------------------------------------------------- ドパにゃん！ 漢字編 */
.logo-ribbon { font-size: calc(var(--fs) * 0.46); }
.logo-ribbon i:nth-child(5) { animation-delay: -.75s; }
.logo-kanji { margin-top: calc(var(--fs) * 0.08); padding: .08em .6em .12em; font-family: var(--kyoka); font-weight: 600; font-size: calc(var(--fs) * 0.3); color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: 10px; transform: rotate(2deg); box-shadow: 0 4px 0 var(--ink); letter-spacing: .12em; }
.credit { margin: 4px 12px 0; font-size: 10px; line-height: 1.5; opacity: .5; text-align: center; }
.mode-row { flex-wrap: wrap; }
.zukan-btn { background: #fff4c7; }

/* word + furigana cells */
.sheet.kanji { font-family: var(--round); }
.cell.kanji { font-family: var(--kyoka); font-weight: 600; font-size: calc(var(--ch) * 1.55); line-height: 1; color: var(--ink); align-self: center; }
.cell.kanji.kana { font-family: var(--round); font-weight: 700; font-size: calc(var(--ch) * 1.05); color: #4a4f86; }
.cell.kanji.ul { background: linear-gradient(transparent 88%, var(--pink) 88%, var(--pink) 96%, transparent 96%); }
.cell.kanji.target { color: #1b1d4d; }
.sheet.kanji .cell.input { font-size: calc(var(--ch) * .74); margin: 2px 1px; border-radius: 9px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 2px rgba(27, 29, 77, .18); }
.sheet.kanji .cell.input.ok { background: transparent; box-shadow: none; }
.cell.input.shown { color: var(--pink); background: #ffe8f3; box-shadow: inset 0 0 0 2px var(--pink); }
.yomi-tag { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 11px; vertical-align: 2px; }
.card.revenge { outline: 4px dashed #23242f; outline-offset: -8px; }
.card.revenge .qno { color: #e0453a; }

/* pass button */
.card-top { gap: 8px; }
.card-top .qno { margin-left: auto; }
.pass-btn { font: inherit; font-family: var(--round); font-weight: 900; font-size: 14px; padding: 5px 14px; border-radius: 999px; border: 2.5px solid var(--ink); background: #23242f; color: #fff; box-shadow: 0 3px 0 var(--ink); cursor: pointer; touch-action: manipulation; }
.pass-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.pass-btn:disabled { opacity: .45; }
.pass-btn[hidden] { display: none; }
.tally .pn b { color: #23242f; }

/* kana pad */
.kana-pad button { font-family: var(--round); font-weight: 900; font-size: 26px; }
.kana-pad button:disabled { visibility: hidden; }
.kana-pad button.dim { opacity: .28; pointer-events: none; }
.kana-pad button.hint-glow, .kana-pad button.trace { background: #fff3b8; box-shadow: 0 5px 0 var(--ink), 0 0 0 4px var(--yellow); animation: hint-glow .9s ease-in-out infinite; }
body.reduced .kana-pad button.hint-glow, body.reduced .kana-pad button.trace { animation: none; }

/* result: passed words */
.passed-box { margin: 6px 0; padding: 8px 12px; border-radius: 14px; background: #f1f0ff; border: 2px dashed #23242f; text-align: left; }
.passed-box .pl-head { margin: 0 0 4px; font-weight: 900; font-size: 13px; }
.passed-box .pl-head small { font-weight: 700; opacity: .7; margin-left: 6px; }
.passed-box ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.passed-box li b { font-family: var(--kyoka); font-weight: 600; font-size: 18px; margin-right: 4px; }
.passed-box li span { font-size: 12px; color: #e0453a; }

/* zukan */
.zk-tabs { flex-wrap: wrap; justify-content: center; }
.zk-tabs button small { display: block; font-size: 10px; opacity: .7; }
.zk-detail { display: flex; gap: 12px; align-items: flex-start; margin: 6px 14px; padding: 10px 12px; min-height: 92px; border-radius: 16px; background: #fff; border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.zk-empty { margin: auto; font-size: 13px; opacity: .6; }
.zk-big { flex: none; width: 74px; height: 74px; display: grid; place-items: center; font-family: var(--kyoka); font-weight: 600; font-size: 58px; line-height: 1; border-radius: 12px; background: #fff8ec; border: 2px solid var(--ink); }
.zk-info { flex: 1; min-width: 0; font-size: 13px; }
.zk-info p { margin: 0 0 4px; font-weight: 900; }
.zk-info p small { font-weight: 700; opacity: .7; }
.zk-info ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.zk-info li { opacity: .55; }
.zk-info li.ok { opacity: 1; }
.zk-info li span { margin-left: 4px; font-family: var(--kyoka); font-weight: 600; font-size: 12px; opacity: .8; }
.zk-scroll { padding-bottom: 24px; }
.zk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; padding: 4px 14px 20px; }
.zk-k { aspect-ratio: 1; font-family: var(--kyoka); font-weight: 600; font-size: 26px; border-radius: 10px; border: 2px solid rgba(27, 29, 77, .25); background: rgba(255, 255, 255, .55); color: rgba(27, 29, 77, .35); cursor: pointer; padding: 0; }
.zk-k.got { color: var(--ink); background: #fff; border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
#screen-zukan { flex-direction: column; padding: calc(10px + env(safe-area-inset-top)) 0 0; }
.zk-scroll { padding-left: 0; padding-right: 0; }

/* ---------------------------------------------------------------- 脳汁タイピング */
.logo-nou { font-family: var(--chunky); font-weight: 400; font-size: calc(var(--fs) * 0.36); background: #ff4f6d; color: #fff; letter-spacing: .04em; padding: .18em .5em .1em; text-shadow: 2px 2px 0 var(--ink); }
.logo-nou ruby rt { font-family: var(--round); font-weight: 900; font-size: .32em; color: #fff; letter-spacing: .2em; }
.logo-catch { margin-top: 6px; font-family: var(--round); font-weight: 900; font-size: calc(var(--fs) * 0.17); color: var(--ink); transform: rotate(-2deg); }
.mode-chip { align-self: center; font: inherit; font-family: var(--round); font-weight: 900; font-size: 14px; padding: 6px 16px; border-radius: 999px; border: 2.5px solid var(--ink); background: #fff; box-shadow: 0 3px 0 var(--ink); cursor: pointer; }
.grades button small { display: block; font-size: 10px; opacity: .7; }
.grades button { font-size: 15px; }
.pass-btn { min-height: 38px; margin-left: 4px; padding: 4px 16px; font-size: 14px; border: 3px solid #fff; background: linear-gradient(180deg, #ffffff, #f1edff); color: #5b5f8f; box-shadow: var(--nx-soft); }
.pass-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(120, 92, 190, .22); }
.tally .kps b { color: #ff4f6d; }

/* problem card */
.sheet.type { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 0 8px; font-family: var(--round); text-align: center; }
.tp-text { font-weight: 900; font-size: clamp(20px, 6.2vw, 30px); line-height: 1.35; color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; }
.tp-text.solo { display: none; }
.tp-yomi { font-weight: 900; font-size: clamp(16px, 4.6vw, 22px); line-height: 1.5; color: #9a9cc4; letter-spacing: .02em; word-break: break-all; }
.tp-yomi.solo { font-size: clamp(26px, 8vw, 40px); }
.tp-yomi span { display: inline-block; transition: color .08s; }
.tp-yomi span.ok { color: #ff4f6d; }
.tp-yomi span.now { color: var(--ink); border-bottom: 3px solid var(--blue); }
.tp-yomi span.half { color: #3b6bff; }
.tp-roma { font-family: "Dela Gothic One", var(--round); font-size: clamp(14px, 4vw, 19px); letter-spacing: .06em; color: #b9bbd8; word-break: break-all; min-height: 1.3em; }
.tp-roma .d { color: #ff4f6d; }
.tp-roma .n { color: #fff; background: var(--blue); border-radius: 5px; padding: 0 3px; }
.tp-roma.blind .n { background: none; color: transparent; }
.sheet-wrap { min-height: 150px; }

/* keyboards */
.pad.tpad { display: block; padding: 0 6px; position: relative; }
.pad.tpad .kr { display: flex; gap: 4px; justify-content: center; margin-bottom: 5px; }
.pad.tpad .kr.r1 { padding-left: 3%; }
.pad.tpad .kr.r2 { padding-left: 8%; padding-right: 8%; }
.pad.tpad.roma .tk { flex: 1 1 0; min-width: 0; height: 52px; padding: 0; font-family: "Dela Gothic One", var(--round); font-size: 18px; border-radius: 9px; }
.tk.home::after { content: ""; position: absolute; left: 35%; right: 35%; bottom: 7px; height: 3px; border-radius: 2px; background: currentColor; opacity: .5; }
.tk { position: relative; }
.tk.f1, .tk.f8 { background: #ffe0ec; } .tk.f2, .tk.f7 { background: #fff1c2; } .tk.f3, .tk.f6 { background: #dff7ea; } .tk.f4, .tk.f5 { background: #e2ebff; }
.tk.next { background: var(--yellow) !important; box-shadow: 0 5px 0 var(--ink), 0 0 0 4px #fff, 0 0 18px 6px rgba(255, 122, 182, .9) !important; transform: translateY(-2px); z-index: 2; }
.tk.alt { outline: 3px dashed var(--pink); outline-offset: -4px; }
.pad.tpad.flick { display: grid; grid-template-columns: repeat(3, 1fr) .8fr; gap: 6px; padding: 0 10px; }
.pad.tpad.flick .tk { height: 58px; font-family: var(--round); font-weight: 900; font-size: 24px; border-radius: 12px; background: #fff; touch-action: none; }
.pad.tpad.flick .tk.fn { font-size: 15px; background: #e8e9f5; }
.pad.tpad.flick .tk[data-k=""] { visibility: hidden; }
.fl-dir { position: absolute; top: -14px; right: -6px; font-style: normal; font-size: 16px; line-height: 1; padding: 3px 6px; border-radius: 999px; background: #ff4f6d; color: #fff; border: 2px solid var(--ink); }
.fl-pop { position: absolute; transform: translate(-50%, -100%); min-width: 56px; padding: 6px 10px; border-radius: 14px; background: var(--ink); color: #fff; font-family: var(--round); font-weight: 900; font-size: 30px; text-align: center; pointer-events: none; z-index: 5; }
@media (max-height: 700px) { .pad.tpad.roma .tk { height: 46px; } .pad.tpad.flick .tk { height: 50px; } }

/* rank box on the result */
.rank-box { margin: 6px 0; padding: 10px 12px; border-radius: 18px; background: linear-gradient(135deg, #fff1c2, #ffe0ec); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.rk-name { margin: 0; display: flex; flex-direction: column; align-items: center; }
.rk-name small { font-size: 12px; opacity: .7; }
.rk-name b { display: inline-block; font-family: var(--chunky); font-weight: 400; font-size: 38px; color: #ff4f6d; text-shadow: 2px 2px 0 var(--ink); }
.rk-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 6px 0; }
.rk-nums span { display: flex; flex-direction: column; align-items: center; }
.rk-nums small { font-size: 10px; opacity: .7; }
.rk-nums b { font-family: var(--chunky); font-weight: 400; font-size: 20px; }
.rk-weak { margin: 0 0 6px; font-size: 12px; }
.rk-weak b { color: #7a4bff; font-size: 16px; letter-spacing: .2em; }
.share-btn { width: 100%; }
.ipick { display: flex; gap: 8px; } .ipick button { flex: 1; font: inherit; font-family: var(--round); font-weight: 900; font-size: 14px; padding: 10px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; box-shadow: 0 3px 0 var(--ink); } .ipick button[aria-pressed="true"] { background: var(--yellow); }

/* rotate notice (phones in landscape) */
.rotate { display: none; position: fixed; inset: 0; z-index: 999; background: var(--paper); place-items: center; text-align: center; font-family: var(--round); font-weight: 900; font-size: 22px; color: var(--ink); }
.rot-cat { font-size: 56px; margin: 0; animation: rot-wiggle 1.2s ease-in-out infinite; }
@keyframes rot-wiggle { 50% { transform: rotate(-90deg); } }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) { .rotate { display: grid; } }
/* FEVER */
body.fever .card { box-shadow: 0 0 0 5px #fff, 0 0 0 10px #ff4f6d, 0 0 40px 12px rgba(255, 122, 182, .9); animation: fever-card .5s linear infinite; }
body.fever .pad.tpad .tk { animation: fever-key 1s linear infinite; }
body.fever #combo-box { background: linear-gradient(90deg, #ff4f6d, #ffd23f, #3fdcb0, #3b6bff, #a77bff); color: #fff; }
@keyframes fever-card { 50% { box-shadow: 0 0 0 5px #fff, 0 0 0 10px #3b6bff, 0 0 48px 16px rgba(255, 210, 63, .95); } }
@keyframes fever-key { to { filter: hue-rotate(360deg); } }
body.reduced.fever .card, body.reduced.fever .pad.tpad .tk { animation: none; }

/* ---------------------------------------------------------------- cute cat logo */
.logo-cat { --fs: clamp(58px, 18vw, 88px); margin-top: calc(var(--fs) * 0.35); padding: calc(var(--fs) * .22) calc(var(--fs) * .3) calc(var(--fs) * .18); }
.logo-cat .logo-burst { display: none; }
.lc-cloud { position: absolute; inset: 0 -4% -4%; width: 108%; height: 104%; z-index: -1; filter: drop-shadow(0 6px 0 rgba(27, 29, 77, .85)); animation: lc-breathe 3.2s ease-in-out infinite; }
@keyframes lc-breathe { 50% { transform: scale(1.025, .985); } }
.lc-top { display: flex; align-items: flex-end; font-family: var(--chunky); font-size: var(--fs); line-height: 1; letter-spacing: -.02em; }
.lc-top i { font-style: normal; position: relative; display: inline-block; color: #ff7ab6; text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink), 2px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 0 7px 0 var(--ink); animation: lc-bounce 1.8s ease-in-out infinite; }
.lc-top i:nth-child(2) { color: #8fe3c4; animation-delay: -.2s; } .lc-top i:nth-child(3) { color: #ffd23f; animation-delay: -.4s; font-size: .82em; }
.lc-top i:nth-child(4) { color: #b8a6ff; animation-delay: -.6s; font-size: .6em; } .lc-top i:nth-child(5) { color: #8fd3ff; animation-delay: -.8s; font-size: .82em; }
.lc-top i.ear::before, .lc-top i.ear::after { content: ""; position: absolute; top: -.2em; width: .26em; height: .3em; background: inherit; background: currentColor; border: 3px solid var(--ink); border-bottom: none; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.lc-top i.ear::before { left: .08em; transform: rotate(-12deg); } .lc-top i.ear::after { right: .08em; transform: rotate(12deg); }
.lc-top i.ear::before, .lc-top i.ear::after { border: none; filter: drop-shadow(0 -2px 0 var(--ink)) drop-shadow(2px 0 0 var(--ink)) drop-shadow(-2px 0 0 var(--ink)); }
.lc-top i.paw-bang { width: .36em; height: .9em; margin-left: .04em; text-shadow: none; }
.lc-top i.paw-bang svg { width: 100%; height: 100%; }
@keyframes lc-bounce { 50% { transform: translateY(-6%) rotate(-3deg); } }
.lc-drop { position: relative; margin-top: calc(var(--fs) * .12); padding: .12em .5em .06em; font-family: var(--chunky); font-size: calc(var(--fs) * .42); color: #fff; background: radial-gradient(circle at 30% 30%, #ffb3d6, #ff4f9a 60%, #c93a86); border: 4px solid var(--ink); border-radius: 50% 50% 46% 46% / 62% 62% 40% 40%; box-shadow: 0 5px 0 var(--ink), inset 6px 6px 0 rgba(255, 255, 255, .35); text-shadow: 2px 2px 0 var(--ink); animation: lc-drip 2.4s ease-in-out infinite; }
.lc-drop::after { content: ""; position: absolute; left: 50%; bottom: -.34em; width: .28em; height: .36em; transform: translateX(-50%); background: #ff4f9a; border: 4px solid var(--ink); border-top: none; border-radius: 0 0 50% 50%; }
.lc-drop ruby rt { font-family: var(--round); font-weight: 900; font-size: .3em; letter-spacing: .25em; color: var(--ink); text-shadow: none; }
@keyframes lc-drip { 50% { transform: scale(1.05, .96) translateY(3%); } }
.lc-sub { margin-top: calc(var(--fs) * .14); font-family: var(--chunky); font-size: calc(var(--fs) * .38); color: #fff; letter-spacing: .06em; text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink), 0 5px 0 var(--ink); background: linear-gradient(90deg, #ff9ccc, #ffd23f, #8fe3c4, #8fd3ff, #b8a6ff); -webkit-background-clip: text; background-clip: text; }
.lc-sub { color: #8fd3ff; }
.lc-peek { position: absolute; width: calc(var(--fs) * 1.05); top: calc(var(--fs) * -.42); z-index: -1; animation: lc-peek 3.6s ease-in-out infinite; }
.lc-gin { left: -2%; transform: rotate(-16deg); } .lc-sumi { right: -2%; transform: rotate(14deg); animation-delay: -1.8s; }
@keyframes lc-peek { 0%, 70%, 100% { translate: 0 0; } 80% { translate: 0 -12%; } }
.lc-bits b { width: calc(var(--fs) * .42); height: calc(var(--fs) * .42); background-size: contain; background-repeat: no-repeat; text-shadow: none; }
.bit-paw { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-14 -14 28 28'%3E%3Cg fill='%23ff9ccc' stroke='%231b1d4d' stroke-width='2'%3E%3Cellipse cx='0' cy='4' rx='7' ry='6'/%3E%3Ccircle cx='-8' cy='-3' r='3.2'/%3E%3Ccircle cx='-3' cy='-8' r='3.2'/%3E%3Ccircle cx='3' cy='-8' r='3.2'/%3E%3Ccircle cx='8' cy='-3' r='3.2'/%3E%3C/g%3E%3C/svg%3E"); }
.bit-fish { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-15 -10 30 20'%3E%3Cg fill='%23c9d3e6' stroke='%231b1d4d' stroke-width='2' stroke-linejoin='round'%3E%3Cellipse cx='-2' cy='0' rx='10' ry='5'/%3E%3Cpath d='M7 0 L13 -5 L13 5Z'/%3E%3C/g%3E%3Ccircle cx='-7' cy='-1' r='1.4' fill='%231b1d4d'/%3E%3C/svg%3E"); }
.bit-yarn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-14 -14 30 30'%3E%3Ccircle r='10' fill='%23b8a6ff' stroke='%231b1d4d' stroke-width='2'/%3E%3Cg fill='none' stroke='%231b1d4d' stroke-width='1.4'%3E%3Cpath d='M-8 -4 Q0 -10 8 -2'/%3E%3Cpath d='M-9 3 Q0 -3 9 5'/%3E%3Cpath d='M9 5 Q15 9 13 14'/%3E%3C/g%3E%3C/svg%3E"); }
.bit-neko { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-14 -16 28 28'%3E%3Cpath d='M-10 -2 L-9 -13 L-3 -8 L3 -8 L9 -13 L10 -2 A10.5 9 0 0 1 -10 -2Z' fill='%23ffd23f' stroke='%231b1d4d' stroke-width='2' stroke-linejoin='round'/%3E%3Ccircle cx='-4' cy='0' r='1.7' fill='%231b1d4d'/%3E%3Ccircle cx='4' cy='0' r='1.7' fill='%231b1d4d'/%3E%3C/svg%3E"); }
.logo-cat .logo-catch { margin-top: calc(var(--fs) * .12); }

/* quit + secret */
.quit-btn { font: inherit; font-family: var(--round); font-weight: 900; font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 2.5px solid var(--ink); background: #fff; box-shadow: 0 2px 0 var(--ink); cursor: pointer; }
.chihaya { font: inherit; padding: 0 2px; border: none; background: none; color: inherit; text-decoration: underline dotted; cursor: pointer; }
.secret-card { text-align: center; background: linear-gradient(135deg, #fff4fa, #eef9ff); }
.secret-title { font-family: var(--chunky); font-size: 20px; margin: 0 0 8px; }
.secret-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 12px; }
.secret-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; }
.secret-dots i.on { background: #ff7ab6; }
.secret-pad { display: flex; justify-content: space-around; align-items: center; margin-bottom: 12px; }
.dpad { display: grid; grid-template: 44px 44px 44px / 44px 44px 44px; }
.dpad .up { grid-area: 1 / 2; } .dpad .left { grid-area: 2 / 1; } .dpad .right { grid-area: 2 / 3; } .dpad .down { grid-area: 3 / 2; }
.dpad button, .ab button { font: inherit; font-weight: 900; font-size: 18px; border: 2.5px solid var(--ink); border-radius: 10px; background: #fff; box-shadow: 0 3px 0 var(--ink); touch-action: manipulation; }
.ab { display: flex; gap: 10px; } .ab button { width: 54px; height: 54px; border-radius: 50%; background: #ffd23f; font-family: var(--chunky); font-size: 22px; }
.logo-cat { --fs: clamp(48px, 14.5vw, 78px); }
.lc-peek { width: calc(var(--fs) * .85); top: 34%; }
.lc-gin { left: -13%; } .lc-sumi { right: -13%; }
.lc-top i.paw-bang { flex: none; }

/* ---- fixes: buttons never wrap vertically, text never leaves the screen */
button, .quit-btn, .big-btn, .sub-btn, .icon-btn, .mode-chip { white-space: nowrap; }
.quit-btn, .icon-btn, #mute { flex: none; }
.cutin-band .band-text { max-width: 100vw; }

/* ================= layout fixes (PC + phone) ================= */
.hud { gap: 6px; min-width: 0; }
.hud .pips { flex: 1 1 0; min-width: 0; overflow: hidden; }
/* brand in the corner of the play screen: firefly + name + address (phones: firefly + address) */
.hud-brand { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px 0 5px; border-radius: 999px; background: rgba(255, 255, 255, .88); box-shadow: 0 3px 0 rgba(27, 29, 77, .18); color: var(--ink); line-height: 1; white-space: nowrap; pointer-events: none; }
.hud-brand img { width: 22px; height: 22px; display: block; }
.hud-brand b { font-family: var(--round); font-weight: 900; font-size: 14px; }
.hud-brand small { font-weight: 900; font-size: 11px; color: #6b6f9e; letter-spacing: .02em; }
@media (max-width: 560px) { .hud-brand { height: 26px; padding: 0 7px 0 3px; gap: 3px; } .hud-brand b { display: none; } .hud-brand img { width: 18px; height: 18px; } .hud-brand small { font-size: 10px; } .hud .clock #clock-label { display: none; } }
.credit .site { font-weight: 900; letter-spacing: .02em; }
/* the site address under the logo */
.logo-url { margin-top: 8px; padding: 2px 14px; border-radius: 999px; border: 2.5px solid var(--ink); background: #fff; color: var(--ink); font-family: "Andika", var(--round); font-weight: 900; font-size: calc(var(--fs) * 0.16); line-height: 1.5; letter-spacing: .03em; box-shadow: 0 3px 0 var(--ink); }
/* rhythm: the next key breathes with the beat; the build-up before a combo target shakes the combo box */
#pad .tk.next { scale: calc(1 + .07 * var(--bp, 0)); }
body.charge #combo-box { animation: charge-shake .09s linear infinite; filter: saturate(calc(1 + var(--charge, 0))) brightness(calc(1 + .25 * var(--charge, 0))); }
body.charge #pad { filter: drop-shadow(0 0 calc(18px * var(--charge, 0)) rgba(255, 210, 63, .9)); }
@keyframes charge-shake { 0% { translate: calc(-2px * var(--charge, 0)) 0; } 50% { translate: calc(2px * var(--charge, 0)) calc(-1px * var(--charge, 0)); } 100% { translate: calc(-2px * var(--charge, 0)) 0; } }
body.reduced.charge #combo-box { animation: none; }
.hud .clock { flex: none; }
.demo-tag { flex: none; }
.step-label { white-space: normal; overflow-wrap: anywhere; padding: 0 10px; line-height: 1.35; font-size: clamp(11px, 3.4vw, 14px); }
.guide-actions button { white-space: nowrap; min-width: 84px; }
.co-tabs { flex-wrap: wrap; justify-content: center; overflow: visible; padding: 2px 10px 8px; }
.co-tabs button { padding: 3px 10px; }
.co-lock { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* ---- logo (re-laid out so nothing is clipped and the catch-phrase is readable) ---- */
.logo-cat { --fs: clamp(44px, 13vw, 70px); width: min(100%, 420px); display: flex; flex-direction: column; align-items: center; margin-top: calc(var(--fs) * .3); padding: calc(var(--fs) * .5) calc(var(--fs) * .3) calc(var(--fs) * .62); box-sizing: border-box; }
.lc-cloud { inset: 0; width: 100%; height: 100%; }
.lc-peek { width: calc(var(--fs) * .8); top: calc(var(--fs) * -.42); z-index: 0; }
.lc-gin { left: 3%; } .lc-sumi { right: 3%; }
.lc-cloud { z-index: 1; }
.lc-top, .lc-drop, .lc-sub, .logo-cat .logo-catch, .lc-bits { position: relative; z-index: 2; }
.lc-drop { font-size: calc(var(--fs) * .66); margin-top: calc(var(--fs) * .1); padding: .1em .55em .04em; }
.lc-drop ruby rt { font-size: .26em; }
.lc-sub { font-size: calc(var(--fs) * .4); margin-top: calc(var(--fs) * .2); }
.logo-cat .logo-catch { margin-top: calc(var(--fs) * .2); padding: .12em .9em .16em; font-size: calc(var(--fs) * .3); background: #ffd23f; color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); transform: rotate(-2deg); white-space: nowrap; }
.lc-bits { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.logo-cat.wiggle { animation: logo-wiggle .6s ease; }
@keyframes logo-wiggle { 20% { transform: rotate(-3deg) scale(1.03); } 50% { transform: rotate(3deg) scale(1.05); } 80% { transform: rotate(-1.5deg); } }
.lc-peek { pointer-events: auto; cursor: pointer; }
.lc-peek.pop { animation: lc-pop .55s ease; }
@keyframes lc-pop { 40% { translate: 0 -30%; scale: 1.15; } }

/* ---- ちはや: an obviously tappable rainbow pill ---- */
.credit { opacity: .85; font-size: 11px; line-height: 2.2; }
.chihaya { display: inline-flex; align-items: center; gap: .25em; min-height: 32px; padding: 2px 14px; border: 2.5px solid var(--ink); border-radius: 999px; font: inherit; font-weight: 900; font-size: 14px; color: var(--ink); text-decoration: none; background: linear-gradient(90deg, #ff9ccc, #ffd23f, #8fe3c4, #8fd3ff, #b8a6ff, #ff9ccc); background-size: 200% 100%; box-shadow: 0 3px 0 var(--ink); cursor: pointer; animation: chi-slide 3s linear infinite, chi-pulse 1.8s ease-in-out infinite; }
@keyframes chi-slide { to { background-position: 200% 0; } }
@keyframes chi-pulse { 50% { transform: scale(1.08) rotate(-2deg); } }
body.reduced .chihaya { animation: none; }

/* ---- urawaza banner ---- */
.urawaza { position: fixed; left: 50%; top: 38%; z-index: 60; transform: translate(-50%, -50%); max-width: 90vw; padding: 14px 26px; text-align: center; border: 4px solid var(--ink); border-radius: 28px; background: linear-gradient(90deg, #ff9ccc, #ffd23f, #8fe3c4, #8fd3ff, #b8a6ff); box-shadow: 0 8px 0 var(--ink); pointer-events: none; animation: ura-pop 3s ease forwards; }
.urawaza b { display: block; font-family: var(--chunky); font-weight: 400; font-size: clamp(22px, 7vw, 34px); color: #fff; text-shadow: 2px 2px 0 var(--ink); white-space: nowrap; }
.urawaza small { font-weight: 900; font-size: clamp(12px, 3.8vw, 16px); color: var(--ink); }
.urawaza[hidden] { display: none; }
@keyframes ura-pop { 0% { transform: translate(-50%, -50%) scale(.3) rotate(-8deg); opacity: 0; } 12% { transform: translate(-50%, -50%) scale(1.12) rotate(2deg); opacity: 1; } 22% { transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { transform: translate(-50%, -60%) scale(1); opacity: 0; } }

/* ---- jarashi toy on the title ---- */
.jarashi { position: fixed; left: 0; top: 0; z-index: 8; display: none; pointer-events: none; transform-origin: 50% 100%; will-change: transform; }
body.on-title .jarashi { display: block; }

/* ---- narrow phones: the play HUD must fit on one row (also with DEMO on) ---- */
@media (max-width: 380px) {
  .hud { padding: 0 8px; gap: 4px; }
  .hud .clock #clock-label { display: none; }
  .demo-tag { padding: 2px 7px; font-size: 11px; }
  .quit-btn { padding: 4px 8px; font-size: 11px; }
  .tree-lanes span { font-size: 10px; }
  .node { font-size: 10px; padding: 3px 2px; }
}
[hidden] { display: none !important; }

/* ---- collection cards: long names/conditions never overflow ---- */
.co-item { overflow: hidden; }
.co-name { max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.co-item small, .co-lock { max-width: 100%; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: normal; overflow-wrap: anywhere; }
.co-item .co-th { max-width: 100%; }
#co-preview { cursor: pointer; touch-action: manipulation; }
#co-now { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= share modal ================= */
.share { z-index: 40; align-items: center; }
.share-card { position: relative; width: min(440px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(160deg, #fff4fa, #eef9ff 60%, #fff8df); text-align: center; }
.share-x { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; z-index: 2; }
.share-title { margin: 2px 40px 8px; font-family: var(--chunky); font-weight: 400; font-size: 24px; color: #ff4f9a; text-shadow: 2px 2px 0 var(--ink); }
.share-preview { position: relative; width: 100%; border-radius: 20px; overflow: hidden; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); background: #fff repeating-conic-gradient(#ffe3f1 0 25%, #fff4cf 0 50%) 0 0 / 40px 40px; min-height: 160px; }
.share-preview img { display: block; width: 100%; height: auto; max-height: 52dvh; object-fit: contain; margin: 0 auto; transition: opacity .3s; -webkit-touch-callout: default; user-select: auto; }
.share-load { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-weight: 900; color: var(--ink); animation: pulse-t 1s ease-in-out infinite; }
@keyframes pulse-t { 50% { opacity: .4; } }
.share-fmt { display: flex; gap: 8px; justify-content: center; margin: 10px 0 8px; }
.share-fmt button { flex: 1; max-width: 140px; min-height: 36px; font: inherit; font-weight: 900; font-size: 13px; border-radius: 999px; border: 2.5px solid var(--ink); background: #fff; box-shadow: 0 2px 0 var(--ink); }
.share-fmt button[aria-pressed="true"] { background: var(--yellow); }
.share-main { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; margin-bottom: 8px; }
.share-main button { min-height: 50px; font: inherit; font-weight: 900; font-size: 14px; border-radius: 16px; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.sh-save { background: linear-gradient(180deg, #ffe680, #ffd23f); } .sh-copy { background: #fff; }
.share-main button:active, .sns:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.share-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sns { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 52px; padding: 4px 6px; font: inherit; border-radius: 14px; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); color: #fff; line-height: 1.2; }
.sns b { font-family: var(--chunky); font-weight: 400; font-size: 17px; letter-spacing: .02em; }
.sns span { font-weight: 900; font-size: 10.5px; opacity: .95; }
.sns-x { background: #111; } .sns-line { background: #06c755; } .sns-fb { background: #1877f2; } .sns-bsky { background: #0a84ff; } .sns-threads { background: #333; }
.sns-insta { background: linear-gradient(45deg, #f9a03f, #f4356a 45%, #b12fbf 75%, #5a5df0); } .sns-more { background: #7a4bff; } .sns-url { background: #fff; color: var(--ink); }
.share-note { min-height: 2.6em; margin: 8px 4px 2px; font-size: 12px; font-weight: 900; color: #7a4bff; line-height: 1.4; }
.share-credit { margin: 0; font-size: 12px; font-weight: 900; }
.share-credit a, .xlink { color: var(--ink); text-decoration: none; padding: 1px 8px; border-radius: 999px; background: #111; color: #fff; font-size: 11px; margin-left: 4px; white-space: nowrap; }
.xlink { display: inline-block; line-height: 1.7; }
@media (min-width: 700px) { .share-card { width: 760px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; text-align: center; align-content: start; } .share-title, .share-preview, .share-fmt { grid-column: 1; } .share-main, .share-grid, .share-note, .share-credit { grid-column: 2; } .share-preview { grid-row: 2 / span 3; align-self: start; } .share-title { grid-row: 1; } .share-main { grid-row: 2; margin-top: 0; } .share-grid { grid-row: 3; } .share-note { grid-row: 4; } .share-credit { grid-row: 5; } .share-fmt { grid-row: 5; margin: 0; } }

/* ================= マタタビモード ================= */
.mata { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 10px; border: 3px solid var(--ink); border-radius: 999px; background: linear-gradient(90deg, #c8f5b8, #fff6a8, #ffc7e6, #c9d6ff); box-shadow: 0 3px 0 var(--ink); font-weight: 900; font-size: 12px; white-space: nowrap; animation: mata-chip 1s ease-in-out infinite; }
.mata[hidden] { display: none; }
.mata i { display: block; width: 84px; height: 10px; border-radius: 6px; border: 2px solid var(--ink); background: #fff; overflow: hidden; }
.mata b { display: block; height: 100%; transform-origin: 0 50%; background: linear-gradient(90deg, #3fdcb0, #ffd23f, #ff7ab6); }
@keyframes mata-chip { 50% { transform: translateX(-50%) rotate(-2deg) scale(1.05); } }
body.matatabi #bg { animation: mata-hue 6s linear infinite, mata-zoom 1.8s ease-in-out infinite; filter: saturate(1.5); }
body.matatabi .card { animation: mata-sway 1.7s ease-in-out infinite; box-shadow: 0 0 0 5px #fff, 0 0 0 10px #8fe3c4, 0 0 40px 12px rgba(143, 227, 196, .9); }
body.matatabi .tp-yomi span:nth-child(odd) { animation: mata-bob 1.1s ease-in-out infinite; }
body.matatabi .tp-yomi span:nth-child(even) { animation: mata-bob 1.1s ease-in-out infinite reverse; }
body.matatabi .pad.tpad .tk { animation: mata-key 1.3s ease-in-out infinite, fever-key 2s linear infinite; }
body.matatabi .pad.tpad .kr.r1 .tk { animation-delay: -.3s; } body.matatabi .pad.tpad .kr.r2 .tk { animation-delay: -.6s; }
@keyframes mata-hue { to { filter: saturate(1.5) hue-rotate(360deg); } }
@keyframes mata-zoom { 50% { transform: scale(1.04); } }
@keyframes mata-sway { 0%, 100% { transform: rotate(-1.1deg) translateY(0); } 50% { transform: rotate(1.1deg) translateY(-3px); } }
@keyframes mata-bob { 50% { transform: translateY(-3px) rotate(2deg); } }
@keyframes mata-key { 50% { transform: rotate(-2.5deg) translateY(-2px); } }
body.reduced .mata, body.reduced.matatabi #bg, body.reduced.matatabi .card, body.reduced.matatabi .tp-yomi span, body.reduced.matatabi .pad.tpad .tk { animation: none; }

/* ================= polish: splash, iris wipe, parallax, button juice ================= */
#splash { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: radial-gradient(circle at 50% 40%, #fff4fa, #ffe3f1 45%, #ffd8ec); transition: opacity .6s ease, transform .6s ease; pointer-events: none; }
#splash.done { opacity: 0; transform: scale(1.06); }
.sp-cats { display: flex; gap: 6px; animation: sp-bounce 1s ease-in-out infinite; } .sp-cats img { width: 30vw; max-width: 130px; }
.sp-cats img:last-child { animation: sp-bounce 1s ease-in-out infinite reverse; }
.sp-logo { margin: 8px 0 0; font-family: var(--chunky); font-size: clamp(34px, 11vw, 54px); color: #ff7ab6; text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink), 0 6px 0 var(--ink); }
.sp-sub { margin: 0; font-family: var(--chunky); font-size: clamp(18px, 6vw, 28px); color: #8fd3ff; text-shadow: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink); }
.sp-load { margin: 14px 0 0; display: flex; gap: 8px; } .sp-load i { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); animation: sp-dot 0.9s ease-in-out infinite; } .sp-load i:nth-child(2) { animation-delay: .15s; background: #ff7ab6; } .sp-load i:nth-child(3) { animation-delay: .3s; background: #ffd23f; }
@keyframes sp-bounce { 50% { transform: translateY(-14px) rotate(-3deg); } } @keyframes sp-dot { 50% { transform: translateY(-9px); } }

#wipe { position: fixed; inset: 0; z-index: 900; pointer-events: none; display: none; }
#wipe.go { display: block; animation: wipe-iris .6s cubic-bezier(.6, 0, .2, 1) forwards; background: conic-gradient(from 0deg, #ff9ccc, #ffd23f, #8fe3c4, #8fd3ff, #b8a6ff, #ff9ccc); }
#wipe i { position: absolute; left: 50%; top: 50%; width: 22vmin; height: 22vmin; transform: translate(-50%, -50%); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-14 -14 28 28'%3E%3Cg fill='%23fff' stroke='%231b1d4d' stroke-width='1.6'%3E%3Cellipse cx='0' cy='4' rx='7' ry='6'/%3E%3Ccircle cx='-8' cy='-3' r='3.2'/%3E%3Ccircle cx='-3' cy='-8' r='3.2'/%3E%3Ccircle cx='3' cy='-8' r='3.2'/%3E%3Ccircle cx='8' cy='-3' r='3.2'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
@keyframes wipe-iris { 0% { clip-path: circle(150% at 50% 50%); } 100% { clip-path: circle(0% at 50% 50%); } }

#screen-title .logo { transform: translate(calc(var(--px, 0) * -10px), calc(var(--py, 0) * -6px)); transition: transform .25s ease-out; }
@media (hover: hover) {
  .big-btn, .sub-btn, .co-item, .node:not(.locked), .tk { transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; }
  .big-btn:hover, .sub-btn:hover { transform: translateY(-2px) rotate(-.6deg); filter: brightness(1.04); }
  .co-item:hover, .node:not(.locked):hover { transform: translateY(-3px); }
  .tk:hover { filter: brightness(1.06); }
}
.big-btn:active, .sub-btn:active { transform: translateY(3px) scale(.985) !important; }
.rk-name b { display: inline-block; }
body.reduced #wipe, body.reduced #splash { display: none; }
@media (prefers-reduced-motion: reduce) { #wipe { display: none !important; } .lc-cloud, .lc-top i, .lc-drop, .lc-peek, .chihaya { animation: none !important; } }

/* ---- result rank box + share modal fixes ---- */
.rank-box .share-btn { width: 100%; height: auto; min-height: 48px; padding: 8px 10px; font-size: 16px; letter-spacing: 0; white-space: normal; line-height: 1.25; }
.rk-nums { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.rk-nums small { white-space: nowrap; font-size: 9px; letter-spacing: -.02em; }
.rk-nums b { font-size: clamp(14px, 4.6vw, 20px); }
.rank-box { overflow: hidden; }
.share-card > * { flex: none; }
.share-preview { flex: none; height: auto; }
.share-preview img { height: auto; min-height: 120px; }

/* ================= name, logo charge/burst, tutorial cats, sticky share ================= */
body.guide-open #fx { z-index: 12; }
#guide-cats { position: absolute; left: 0; right: 0; top: max(76px, calc(47% - 168px)); display: flex; justify-content: center; gap: 14px; pointer-events: none; }
#guide-cats .gc { pointer-events: auto; width: min(38vw, 150px); padding: 0; border: none; background: none; cursor: pointer; touch-action: manipulation; filter: drop-shadow(0 6px 0 rgba(27, 29, 77, .35)); }
#guide-cats .gc img { width: 100%; display: block; pointer-events: none; }
#guide-cats .gc:first-child { transform: rotate(-6deg); } #guide-cats .gc:last-child { transform: rotate(6deg); }
#guide-cats .gc.pop { animation: gc-pop .5s ease; }
@keyframes gc-pop { 30% { translate: 0 -16%; scale: 1.14; } 60% { translate: 0 2%; scale: .96; } }

.name-card { text-align: center; }
.name-cats { display: flex; justify-content: center; gap: 4px; margin: -6px 0 2px; } .name-cats img { width: 84px; }
.name-title { margin: 0; font-family: var(--chunky); font-weight: 400; font-size: 24px; color: #ff4f9a; text-shadow: 2px 2px 0 var(--ink); }
.name-sub { margin: 6px 0 12px; font-size: 12px; font-weight: 900; opacity: .75; }
.name-input { width: 100%; box-sizing: border-box; height: 52px; padding: 0 16px; border: 3px solid var(--ink); border-radius: 16px; background: #fff; font: inherit; font-weight: 900; font-size: 18px; text-align: center; color: var(--ink); outline: none; }
.name-input:focus { box-shadow: 0 0 0 4px #ffd23f; }
.name-actions { display: flex; gap: 10px; margin-top: 14px; } .name-actions button { flex: 1; min-height: 50px; }
.name-row { display: flex; gap: 8px; } .name-row .name-input { height: 44px; font-size: 16px; } .name-row .sub-btn { flex: none; padding: 0 14px; }
.hello { margin: -6px 0 0; padding: 4px 16px; border-radius: 999px; background: #fff; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-weight: 900; font-size: 14px; max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: center; }
.hello[hidden] { display: none; }

.logo-cat.charging { z-index: 6; cursor: pointer; }
.logo-cat.boom { animation: logo-boom .9s cubic-bezier(.2, .9, .3, 1) forwards; }
@keyframes logo-boom { 0% { transform: scale(1); } 25% { transform: scale(1.5, 1.7) rotate(-4deg); filter: brightness(1.6); } 45% { transform: scale(.7, .6); } 70% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1); } }
#goo { position: fixed; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; display: none; }
#goo.go { display: block; animation: goo-life 3.4s ease forwards; }
#goo i { position: absolute; top: -260px; border-radius: 48% 52% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 32% 28%, hsl(var(--h) 100% 88%), hsl(var(--h) 90% 66%) 55%, hsl(var(--h) 80% 48%)); box-shadow: inset -8px -10px 0 rgba(255, 255, 255, .25); animation: goo-fall 2s cubic-bezier(.5, 0, .9, .6) forwards; }
.goo-tide { position: absolute; left: -10%; right: -10%; bottom: -70%; height: 70%; background: linear-gradient(180deg, #ff9ccc, #ff4f9a 45%, #b8a6ff); border-radius: 50% 50% 0 0 / 60px 60px 0 0; box-shadow: 0 -14px 0 rgba(255, 255, 255, .5) inset; animation: goo-tide 3.2s ease forwards; }
@keyframes goo-fall { 0% { transform: translateY(0) scaleY(.7); } 80% { transform: translateY(calc(100vh + 300px)) scaleY(1.4); } 100% { transform: translateY(calc(100vh + 300px)) scaleY(1.4); } }
@keyframes goo-tide { 0% { transform: translateY(0); } 30% { transform: translateY(-105%); } 55% { transform: translateY(-100%); } 100% { transform: translateY(20%); } }
@keyframes goo-life { 0%, 78% { opacity: 1; } 100% { opacity: 0; } }
body.reduced #goo { display: none !important; }

.tp-yomi span.lucky { color: #e79a00; text-shadow: 0 0 10px rgba(255, 210, 63, .9); animation: lucky-glow .7s ease-in-out infinite; }
.tp-yomi span.lucky::after { content: "★"; position: absolute; margin: -1.1em 0 0 -.8em; font-size: .6em; color: #ffd23f; }
.tp-yomi span { position: relative; }
@keyframes lucky-glow { 50% { transform: scale(1.22); filter: brightness(1.2); } }

/* result / final: the share + next-step buttons stay on screen (no scrolling to find them) */
.result-card { max-height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.result-card .actions { position: sticky; bottom: 0; z-index: 3; margin: 0 -8px; padding: 10px 8px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(255, 250, 242, 0), rgba(255, 250, 242, .96) 26%); }
.share-cta { background: linear-gradient(180deg, #ffe680, #ffd23f) !important; color: var(--ink) !important; }

#demo-cap { position: fixed; left: 50%; top: 14%; z-index: 30; transform: translateX(-50%) scale(.6); opacity: 0; max-width: 94vw; padding: 10px 28px; border-radius: 999px; border: 4px solid #fff; background: linear-gradient(90deg, #ff4f9a, #ffb347 45%, #3fdcb0); color: #fff; font-family: var(--chunky), var(--round); font-weight: 900; font-size: clamp(20px, 5.2vw, 40px); letter-spacing: .04em; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); box-shadow: 0 7px 0 var(--ink), 0 18px 36px rgba(255, 79, 154, .45); white-space: nowrap; pointer-events: none; }
#demo-cap.show { animation: demo-cap 2.6s ease forwards; }
@keyframes demo-cap { 0% { opacity: 0; transform: translateX(-50%) scale(.3) rotate(-8deg); } 9% { opacity: 1; transform: translateX(-50%) scale(1.25) rotate(3deg); } 16% { transform: translateX(-50%) scale(.95) rotate(-2deg); } 22% { transform: translateX(-50%) scale(1) rotate(-1.5deg); } 82% { opacity: 1; transform: translateX(-50%) scale(1) rotate(-1.5deg); } 100% { opacity: 0; transform: translateX(-50%) translateY(-26px) scale(1.05) rotate(-1.5deg); } }
/* the demo shows the combo large */
body.demo #combo-box { transform: scale(1.55); transform-origin: top left; }

/* ============================================================================
   NX theme — soft, sturdy, friendly menus in the spirit of Nintendo's UI:
   white borders + soft coloured drop shadows, pill buttons, big round cards,
   no heavy black outlines on the chrome (the characters keep theirs).
   ============================================================================ */
:root { --nx-shadow: 0 10px 0 rgba(120, 92, 190, .16), 0 20px 44px rgba(80, 50, 130, .2); --nx-soft: 0 4px 0 rgba(120, 92, 190, .22), 0 10px 18px rgba(80, 50, 130, .12); }
.big-btn { border: 4px solid #fff; border-radius: 999px; background: linear-gradient(180deg, #ff9bd0, #ff4f9a 60%, #ee3a86); color: #fff; text-shadow: 0 2px 0 rgba(150, 20, 85, .5); box-shadow: 0 6px 0 #c22d77, 0 14px 24px rgba(255, 79, 154, .35), inset 0 3px 0 rgba(255, 255, 255, .5); }
.big-btn.share-cta { border-color: #fff; background: linear-gradient(180deg, #fff2a3, #ffd23f 60%, #ffbe1f) !important; color: #5a3b00 !important; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); box-shadow: 0 6px 0 #d49a00, 0 14px 24px rgba(255, 190, 31, .4), inset 0 3px 0 rgba(255, 255, 255, .6); }
.sub-btn, .mode-chip { border: 3px solid #fff; border-radius: 999px; background: linear-gradient(180deg, #ffffff, #f1edff); color: var(--ink); box-shadow: var(--nx-soft); }
.icon-btn { border: 3px solid #fff; background: linear-gradient(180deg, #ffffff, #f1edff); box-shadow: var(--nx-soft); }
.quit-btn { border: 3px solid #fff; background: linear-gradient(180deg, #ffffff, #f1edff); box-shadow: var(--nx-soft); }
.chip { border: 3px solid #fff; box-shadow: 0 4px 0 rgba(30, 60, 190, .35); }
.card, .modal-card, .result-card, .share-card, .cal-card, .quest-card { border: 4px solid #fff; border-radius: 30px; box-shadow: var(--nx-shadow); }
.tally span, .clock, .dopa, .combo, .pips { border-color: #fff; box-shadow: var(--nx-soft); }
.tally span, .clock { border-width: 3px; }
.grades button, .node, .co-item, .cal-day { border: 3px solid #fff; box-shadow: var(--nx-soft); }
.node.locked, .co-item.locked { box-shadow: 0 3px 0 rgba(120, 92, 190, .18); }
.co-item.on { box-shadow: 0 0 0 4px #ff7ab6, var(--nx-soft); }
.pad.tpad.roma .tk { border: 3px solid #fff; border-radius: 12px; box-shadow: 0 4px 0 rgba(120, 92, 190, .3), 0 8px 12px rgba(80, 50, 130, .1); }
.pad.tpad.roma .tk:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(120, 92, 190, .3); }
.tk.next { box-shadow: 0 4px 0 #d49a00, 0 0 0 4px #fff, 0 0 22px 8px rgba(255, 122, 182, .85) !important; }
.toast, .hello, .share-preview, .name-input { border-color: #fff; box-shadow: var(--nx-soft); }
.hello { border-width: 3px; background: linear-gradient(180deg, #fff, #fff6fb); }
.name-input { border: 3px solid #e7defa; box-shadow: inset 0 3px 6px rgba(120, 92, 190, .12); }
.name-input:focus { border-color: #ff7ab6; box-shadow: 0 0 0 4px rgba(255, 122, 182, .35); }
.sns, .share-main button, .share-fmt button { border: 3px solid #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .22), 0 8px 14px rgba(0, 0, 0, .12); }
.share-x { border: 3px solid #fff; }
.chihaya, .xlink, .share-credit a { border-color: #fff; }
.hello::before { content: "🐾 "; }
body { -webkit-tap-highlight-color: transparent; }
.name-actions button { min-width: 0; padding: 0 10px; font-size: 17px; white-space: nowrap; }
.name-card { width: min(360px, calc(100vw - 32px)); box-sizing: border-box; }
.share-cta { font-size: clamp(15px, 4.6vw, 19px); letter-spacing: 0; white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.result-card .actions .share-cta { min-height: 52px; }
/* phones: the "send with picture" button (OS share sheet) comes first and spans the row; PC hides it */
@media (pointer: coarse) { .sns-more { order: -1; grid-column: 1 / -1; min-height: 58px; background: linear-gradient(90deg, #7a4bff, #ff4f9a); } }
@media (pointer: fine) { .sns-more { display: none; } }

/* ---- 90秒チャレンジ / share simplification ---- */
.challenge-btn { background: linear-gradient(180deg, #fff2a3, #ffd23f 60%, #ffbe1f) !important; color: #5a3b00 !important; text-shadow: 0 1px 0 rgba(255, 255, 255, .7) !important; box-shadow: 0 6px 0 #d49a00, 0 14px 24px rgba(255, 190, 31, .4), inset 0 3px 0 rgba(255, 255, 255, .6) !important; margin-top: 2px; }
.challenge-btn small { display: block; font-size: 10px; font-weight: 900; opacity: .8; letter-spacing: 0; }
.sh-send { display: flex; flex-direction: column; align-items: center; width: 100%; min-height: 58px; margin: 0 0 8px; padding: 6px 10px; font: inherit; font-weight: 900; font-size: 16px; color: #fff; border: 3px solid #fff; border-radius: 18px; background: linear-gradient(90deg, #7a4bff, #ff4f9a); box-shadow: 0 5px 0 rgba(90, 40, 160, .5), 0 10px 18px rgba(122, 75, 255, .25); }
.sh-send small { font-size: 10.5px; font-weight: 900; opacity: .92; }
.sh-send[hidden] { display: none; }
.share-main { grid-template-columns: 1fr 1fr; }
.share-main .sh-save { grid-column: 1 / -1; }
.share-main button { min-height: 46px; font-size: 13.5px; }
@media (min-width: 700px) { .sh-send { grid-column: 2; grid-row: 2; } .share-main { grid-row: 3; } .share-note { grid-row: 4; } .share-credit { grid-row: 5; } }
.challenge-btn { width: auto; min-width: 0; align-self: center; padding-left: 22px; padding-right: 22px; max-width: 88%; font-size: clamp(16px, 5vw, 20px); white-space: nowrap; }
.share-main { width: 100%; box-sizing: border-box; }
.share-main button { min-width: 0; padding: 0 6px; white-space: nowrap; font-size: clamp(12px, 3.6vw, 13.5px); }
.share-main .sh-save { white-space: nowrap; }
.share-main { display: grid; grid-template-columns: 1fr 1fr; }
.share-main button:nth-child(4) { grid-column: 1 / -1; }
@media (min-width: 700px) { .share-note { align-self: start; } }
/* share modal: a short lead on wide screens; the right column is centred beside the preview (spacer rows 2 and 7) */
.share-lead { display: none; margin: 0 0 12px; font-size: 14px; font-weight: 900; line-height: 1.6; color: #6b6f9e; }
@media (min-width: 700px) {
  .share-card { grid-template-rows: auto 1fr auto auto auto auto 1fr auto; row-gap: 0; }
  .share-preview { grid-row: 2 / span 6; align-self: center; }
  .share-lead { display: block; grid-column: 2; grid-row: 3; }
  .sh-send { grid-row: 4; } .share-main { grid-row: 5; } .share-note { grid-row: 6; }
  .share-fmt { grid-row: 8; margin-top: 10px; } .share-credit { grid-row: 8; align-self: center; margin-top: 10px; }
}
/* WeChat / QQ in-app browsers: downloads do nothing, so the preview is saved by a long press */
.share-hold { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); margin: 0; padding: 4px 12px; border-radius: 999px; background: rgba(27, 29, 77, .82); color: #fff; font-size: 13px; font-weight: 900; white-space: nowrap; pointer-events: none; }
.share-hold[hidden] { display: none; }

/* ---- result card: the button bar is solid (no see-through, no dashed line over the content) ---- */
.result-card .actions { position: sticky; bottom: 0; z-index: 3; margin: 10px -20px -20px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 0; border-radius: 0 0 24px 24px; background: #fff; box-shadow: 0 -14px 14px -10px rgba(80, 50, 130, .2); }
.result-card { padding-bottom: 0; scrollbar-width: thin; }
.result-card > :nth-last-child(2) { margin-bottom: 10px; }
/* basic result: one primary button (extra), the rest in one compact row so the bar covers less of the card */
#screen-result .actions { gap: 8px 6px; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
#screen-result .actions .big-btn { height: 56px; margin: 0 max(0px, (100% - 360px) / 2); }
#screen-result .actions .sub-btn { height: 42px; min-height: 0; padding: 0 8px; font-size: 13px; }
/* wider screens: the four stats in one row and the rank beside its numbers, so the card needs less scrolling */
@media (min-width: 1000px) and (min-height: 600px) {
  #screen-result .stats, #screen-final .stats { grid-template-columns: repeat(4, 1fr); margin: 12px 0 8px; }
  .result-card .rank-box { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 18px; padding: 8px 18px; }
  .result-card .rank-box .rk-nums { margin: 0; }
  .result-card .rank-box .rk-weak { grid-column: 1 / -1; margin: 4px 0 2px; }
}

/* ================= PC: wider layout (the phone column is no longer used on big screens) ================= */
@media (min-width: 1000px) and (min-height: 600px) {
  #app { width: min(100vw, 1080px); }
  #screen-play .hud, #screen-play .hud2 { padding-left: 32px; padding-right: 32px; }
  .stage { margin: 0 32px; }
  .card { width: min(880px, calc(100% - 64px)); margin-left: auto; margin-right: auto; }
  .sheet-wrap { min-height: 230px; }
  .tp-text { font-size: clamp(34px, 3.2vw, 46px); }
  .tp-yomi { font-size: clamp(24px, 2.2vw, 32px); }
  .tp-yomi.solo { font-size: clamp(34px, 3.2vw, 46px); }
  .tp-roma { font-size: clamp(20px, 1.8vw, 26px); }
  .step-label { font-size: 16px; }
  .pad.tpad { width: min(840px, calc(100% - 64px)); margin-left: auto; margin-right: auto; }
  .pad.tpad.roma .tk { height: 60px; font-size: 22px; }
  .pad.tpad .kr { gap: 8px; margin-bottom: 8px; }
  .modes { width: min(100%, 720px); }
  .grades { width: min(100%, 720px); grid-template-columns: repeat(6, 1fr); }
  .big-btn.level-btn { min-width: 420px; }
  .logo-cat { --fs: clamp(60px, 6vw, 84px); width: min(100%, 540px); }
  .result-card { max-width: 660px; margin-left: auto; margin-right: auto; }
  .quest-card, .cal-card { max-width: 560px; }
  #screen-tree > *, #screen-trophy > *, #screen-collect > *, #screen-zukan > * { max-width: 820px; margin-left: auto; margin-right: auto; width: 100%; box-sizing: border-box; }
  .co-grid { grid-template-columns: repeat(4, 1fr); }
  .share-card { width: 820px; }
}
@media (min-width: 1500px) and (min-height: 860px) {
  #app { width: min(100vw, 1240px); }
  .card { width: min(1000px, calc(100% - 64px)); }
  .pad.tpad { width: min(960px, calc(100% - 64px)); }
  .pad.tpad.roma .tk { height: 70px; font-size: 25px; }
  .tp-text { font-size: 52px; } .tp-yomi { font-size: 36px; } .tp-roma { font-size: 29px; }
}

/* PC title: logo + cats on the left, the whole menu on the right (everything fits without scrolling) */
@media (min-width: 1000px) and (min-height: 600px) {
  #screen-title.is-active { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: 28px; row-gap: 8px; align-content: center; align-items: start; justify-items: center; padding: 28px 40px 24px; overflow-y: auto; }
  #screen-title > .settings-btn { position: absolute; }
  #screen-title > #logo { grid-column: 1; grid-row: 1; margin-top: 6px; }
  #screen-title > .title-stage { grid-column: 1; grid-row: 2; width: 100%; height: min(34vh, 300px); align-self: end; }
  #screen-title > .hello { grid-column: 2; grid-row: 1; align-self: end; justify-self: center; }
  #screen-title > .modes { grid-column: 2; grid-row: 2; align-self: start; width: 100%; }
  #screen-title > .quest-card { grid-column: 1 / -1; grid-row: 3; max-width: 760px; }
  #screen-title .big-btn.level-btn { min-width: 0; width: min(100%, 440px); }
  #screen-title .challenge-btn { width: min(100%, 440px); max-width: none; }
  #screen-title .grades { grid-template-columns: repeat(3, 1fr); width: min(100%, 440px); }
  #screen-title .mode-row { justify-content: center; }
}
@media (min-width: 1000px) and (min-height: 600px) {
  /* row 1: logo | hello+menu   row 2: cats | quests   row 3+: calendar, hint, credit across the width */
  #screen-title.is-active { grid-template-rows: auto auto auto auto auto; align-content: start; }
  #screen-title > #logo { grid-row: 1 / span 2; }
  #screen-title > .title-stage { grid-row: 3; height: min(30vh, 250px); }
  #screen-title > .hello { grid-row: 1; }
  #screen-title > .modes { grid-row: 2 / span 2; }
  #screen-title > .quest-card { grid-column: 1 / -1; grid-row: 4; }
  #screen-title > .cal-card { grid-column: 1 / -1; grid-row: 5; max-width: 760px; }
  #screen-title > .hint, #screen-title > .credit { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- 课本单词 (English edition) */
.tp-text { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--chunky); font-weight: 400; }
.tp-emoji { font-size: 1.2em; }
.tp-say { border: 2.5px solid var(--ink); border-radius: 999px; background: #fff; font-size: 18px; width: 38px; height: 38px; padding: 0; cursor: pointer; box-shadow: 0 3px 0 var(--ink); flex: none; }
.tp-say:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
/* no English voice on this device: the speaker looks off, and the settings note turns into a warning */
.tp-say.no-voice { opacity: .45; filter: grayscale(1); cursor: not-allowed; box-shadow: none; border-style: dashed; }
.set-note.warn { opacity: 1; color: #d9480f; }
.tp-novoice { margin: 0; padding: 3px 12px; border-radius: 999px; background: #fff1e6; color: #d9480f; font-size: 13px; font-weight: 900; }
.tp-yomi.en { font-family: var(--word); font-weight: 700; font-size: clamp(34px, 10vw, 54px); color: #9a9cc4; letter-spacing: .04em; line-height: 1.25; }
.tp-yomi.en span { min-width: .45em; text-align: center; }
.tp-yomi.en span.masked { color: #c9cbe6; }
.tp-yomi.en span.gap { min-width: .6em; }
.tp-yomi.en span.now { color: var(--ink); }
.tp-yomi.en span.now.masked { color: var(--blue); }
.word-star { color: #e79a00; letter-spacing: .05em; }
.units-btn { background: var(--mint); color: var(--ink); }
/* Single column: title and note on two lines, like 开始练习 (the wide panel has its own rule). */
@media not all and (min-width: 1000px) and (min-height: 600px) {
  .units-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
  .units-btn small { font-size: 13px; letter-spacing: 0; }
}
.pad.tpad .kr.r3 .tk { width: min(60%, 420px); flex: none; font-family: var(--chunky); font-size: 16px; }
.pad.tpad .kr.r3 { justify-content: center; }
#tree.units { position: relative; display: block; width: 100%; max-width: 760px; margin: 0 auto; padding: 0 12px 40px; }
.stage-tabs { display: flex; gap: 8px; margin: 4px 0 10px; }
.stage-tabs button { flex: 1; height: 38px; border: 3px solid var(--ink); border-radius: 999px; background: #fff; font-family: var(--round); font-weight: 900; font-size: 16px; color: var(--ink); box-shadow: 0 3px 0 var(--ink); cursor: pointer; }
.stage-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.book-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 14px; }
.book-tabs button { height: 44px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; font-family: var(--chunky); font-size: 18px; color: var(--ink); box-shadow: 0 4px 0 var(--ink); cursor: pointer; }
.book-tabs button[aria-selected="true"] { background: var(--yellow); }
.unit-list { display: grid; gap: 12px; }
.unit-card { display: grid; gap: 8px; width: 100%; text-align: left; padding: 12px 14px; border: 3px solid var(--ink); border-radius: 18px; background: #fff; box-shadow: 0 5px 0 var(--ink); cursor: pointer; color: var(--ink); font-family: var(--round); }
.unit-card.cur { background: #fff6d6; }
.unit-card:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.uc-head { display: flex; align-items: baseline; gap: 10px; }
.uc-head b { font-family: var(--chunky); font-weight: 400; font-size: 20px; color: var(--blue); white-space: nowrap; }
.uc-title { flex: 1; font-family: var(--word); font-size: 18px; }
.uc-count { font-family: var(--chunky); font-size: 14px; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 999px; }
.uc-words { display: flex; flex-wrap: wrap; gap: 6px; }
.wchip { display: inline-flex; flex-direction: column; align-items: center; padding: 3px 8px; border-radius: 10px; background: #eef0ff; font-family: var(--word); font-size: 16px; line-height: 1.15; }
.wchip i { font-style: normal; font-size: 12px; line-height: 1.1; color: #b4b7d9; letter-spacing: .04em; }
.wchip i b { font-weight: inherit; color: #ff9500; }
.wchip.s1 { background: #e6f9f2; } .wchip.s2 { background: #fff1c4; } .wchip.s3 { background: #ffd23f; }
.wchip.s3 i b { color: #c2410c; }
.wchip .zh { display: none; font-family: var(--round); font-size: 12px; line-height: 1.2; color: #5b5e8f; }
.units.zh-on .wchip .zh { display: block; }
.unit-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: -4px 0 12px; }
.unit-tools button { height: 36px; padding: 0 12px; border: 2.5px solid var(--ink); border-radius: 999px; background: #fff; font-family: var(--round); font-weight: 900; font-size: 14px; box-shadow: 0 3px 0 var(--ink); }
.unit-tools .ut-zh::before, .unit-tools .ut-all::before { content: "☐ "; }
.unit-tools .ut-zh[aria-pressed="true"], .unit-tools .ut-all[aria-pressed="true"] { background: var(--mint); }
.unit-tools .ut-zh[aria-pressed="true"]::before, .unit-tools .ut-all[aria-pressed="true"]::before { content: "☑ "; }
.wchip.lite { outline: 1.5px dashed #b4b7d9; outline-offset: -1.5px; }
.uc-prog { display: flex; align-items: center; gap: 8px; }
.uc-bar { flex: 1; height: 10px; border: 2px solid var(--ink); border-radius: 999px; background: #eef0ff; overflow: hidden; }
.uc-bar i { display: block; height: 100%; min-width: 0; background: linear-gradient(90deg, #ffc23f, #ff9500); }
.uc-pnum { font-family: var(--chunky); font-size: 13px; color: #d97a00; white-space: nowrap; }
.uc-acts { justify-self: end; display: flex; gap: 10px; }
.uc-acts button { height: 36px; padding: 0 14px; border: 2.5px solid var(--ink); border-radius: 999px; background: #fff; font-family: var(--chunky); font-size: 15px; box-shadow: 0 3px 0 var(--ink); }
.uc-dict { color: var(--blue); }
.uc-acts .uc-go { color: #fff; background: var(--pink); }
/* 我的词包 (word packs): same cards, plus share / edit / delete */
.uc-acts.pk { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.uc-acts .uc-pk { padding: 0 11px; font-family: var(--round); font-weight: 900; font-size: 14px; }
.uc-head .uc-pn { font-family: var(--round); font-size: 14px; color: #5b5e8f; }
.uc-from { margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 12px; white-space: nowrap; }
.unit-tools .ut-new { margin-right: auto; background: var(--yellow); }
.pack-empty { display: grid; justify-items: center; gap: 10px; padding: 22px 16px; border: 3px dashed #b4b7d9; border-radius: 18px; background: #fff; text-align: center; font-size: 15px; line-height: 1.6; }
.pack-empty p { margin: 0; max-width: 30em; }
.pack-empty .pe-head { font-family: var(--chunky); font-size: 20px; }
.packed { z-index: 40; }
.pk-card { width: min(100%, 560px); gap: 12px; }
.pk-field { display: grid; gap: 6px; font-weight: 900; font-size: 15px; }
.pk-field small { font-size: 12px; color: #5b5e8f; }
.pk-field .name-input { height: 46px; text-align: left; }
.pk-text { width: 100%; box-sizing: border-box; min-height: 9.5em; padding: 10px 14px; border: 3px solid var(--ink); border-radius: 16px; background: #fff; font: inherit; font-family: var(--word), var(--round); font-size: 17px; line-height: 1.5; color: var(--ink); resize: vertical; outline: none; }
.pk-text:focus { box-shadow: 0 0 0 4px #ffd23f; }
.pk-preview { display: grid; gap: 6px; font-size: 14px; }
.pk-preview p { margin: 0; }
.pk-count b { color: var(--blue); font-size: 17px; }
.pk-words { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pk-words li { display: inline-flex; flex-direction: column; align-items: center; padding: 3px 8px; border-radius: 10px; background: #eef0ff; line-height: 1.2; }
.pk-words b { font-family: var(--word); font-size: 16px; }
.pk-words small { font-size: 12px; color: #5b5e8f; }
.pk-preview .auto { color: #0a8f6c; font-style: normal; font-weight: 900; }
.pk-words small.none { color: #9a9cc4; }
.pk-note { font-size: 13px; color: #5b5e8f; }
.pk-skip { margin: 0; padding-left: 1.2em; font-size: 13px; color: #d9480f; }
.pk-tidy { display: grid; gap: 6px; }
.pk-tidy pre { margin: 0; max-height: 9em; overflow: auto; padding: 8px 12px; border: 2px dashed #c9cbe8; border-radius: 12px; background: #fff; font-family: var(--word), var(--round); font-size: 14px; white-space: pre-wrap; }
.pk-tidy .sub-btn { justify-self: start; min-width: 0; height: 40px; padding: 0 14px; font-size: 15px; border-radius: 14px; box-shadow: 0 3px 0 var(--ink); }
.pk-err { margin: 0; color: var(--red); font-weight: 900; text-align: center; }
.pk-actions { display: flex; justify-content: center; gap: 12px; position: sticky; bottom: -20px; padding: 10px 0 2px; background: var(--paper); }
.pk-actions .sub-btn { min-width: 0; padding: 0 20px; }
.pk-actions .big-btn { min-width: 150px; height: 52px; font-size: 22px; }
.confirm-msg .pk-link { display: block; margin-top: 10px; height: 44px; font-size: 13px; text-align: left; user-select: text; -webkit-user-select: text; }
.tp-text.no-zh .tp-say { width: 56px; height: 56px; font-size: 28px; }
.wordlist { z-index: 40; }
.wl-card { width: min(100%, 760px); max-height: 100%; gap: 10px; user-select: text; -webkit-user-select: text; }
.wl-title { margin: 0; font-family: var(--chunky); font-weight: 400; font-size: 22px; text-align: center; }
.wl-sub { margin: 0; font-size: 13px; text-align: center; color: #5b5e8f; }
.wl-unit h3 { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 4px; font-size: 16px; border-bottom: 2px dashed #c9cbe8; }
.wl-unit h3 small { margin-left: auto; font-size: 12px; color: #5b5e8f; }
.wl-unit ul { margin: 0; padding: 0; list-style: none; columns: 3 170px; column-gap: 14px; }
.wl-unit li { display: flex; align-items: baseline; gap: 6px; padding: 2px 0; break-inside: avoid; font-size: 14px; }
.wl-unit li b { font-family: var(--word); font-size: 16px; color: var(--ink); }
.wl-unit li span { flex: 1; min-width: 0; color: #5b5e8f; }
.wl-unit li i { font-style: normal; font-size: 12px; color: #d97a00; white-space: nowrap; }
.wl-empty { text-align: center; font-size: 18px; }
.wl-actions { display: flex; justify-content: center; gap: 12px; position: sticky; bottom: -20px; padding: 10px 0 2px; background: var(--paper); }
.wl-actions .big-btn { min-width: 160px; height: 52px; font-size: 20px; }
.wl-actions .big-btn:disabled { opacity: .45; }
/* parents' page (家长看这里) */
.print-only { display: none; }
.pp-card { width: min(100%, 860px); gap: 14px; }
.pp-sub { margin-top: -8px; }
.pp-sec { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px 14px; border: 2.5px solid var(--ink); border-radius: 18px; background: #fff; box-shadow: 0 4px 0 var(--ink); }
.pp-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 0; font-family: var(--chunky); font-weight: 400; font-size: 17px; color: var(--blue); }
.pp-h small { font-family: var(--round); font-weight: 900; font-size: 12px; color: #5b5e8f; }
.pp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.pp-days li { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pp-days i { display: grid; place-items: center; width: 32px; height: 32px; border: 2.5px solid #c9cbe8; border-radius: 50%; background: #f4f5ff; color: #fff; }
.pp-days i svg { width: 18px; height: 18px; }
.pp-days .on i { border-color: var(--ink); background: var(--mint); box-shadow: 0 2px 0 var(--ink); }
.pp-days .nc i { border-style: dashed; border-color: #c98a4b; background: #fff3e2; }
.pp-days small { font-size: 12px; font-weight: 900; color: #5b5e8f; }
.pp-days .today small { color: var(--pink); }
.pp-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pp-nums span { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: 12px; background: #fff8ec; text-align: center; }
.pp-nums b { font-family: var(--chunky); font-weight: 400; font-size: 24px; line-height: 1.1; color: var(--ink); }
.pp-nums b em { font-style: normal; font-size: 14px; color: #5b5e8f; }
.pp-nums small { font-size: 12px; font-weight: 900; color: #5b5e8f; }
.pp-books { margin: 0; }
.pp-books button { height: 38px; font-size: 16px; box-shadow: 0 3px 0 var(--ink); }
.pp-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-size: 12px; font-weight: 900; color: #5b5e8f; }
.pp-legend span::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 4px; border: 1.5px solid var(--ink); border-radius: 3px; vertical-align: -1px; background: var(--k); }
.pp-card { --k0: #e3e5f7; --k1: #9fe6cf; --k2: #ffd166; --k3: #ff9500; }
.pp-legend .k0, .pp-seg .k0 { --k: var(--k0); } .pp-legend .k1, .pp-seg .k1 { --k: var(--k1); } .pp-legend .k2, .pp-seg .k2 { --k: var(--k2); } .pp-legend .k3, .pp-seg .k3 { --k: var(--k3); }
.pp-ulist { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pp-ulist li { display: grid; grid-template-columns: minmax(0, 13em) minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.pp-uname { display: flex; align-items: baseline; gap: 5px; min-width: 0; font-size: 14px; white-space: nowrap; }
.pp-uname b { flex: none; font-family: var(--chunky); font-weight: 400; }
.pp-uname span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pp-uname em { flex: none; padding: 1px 6px; border-radius: 999px; background: var(--pink); color: #fff; font-style: normal; font-size: 11px; font-weight: 900; }
.pp-seg { display: flex; height: 20px; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--k0); }
.pp-seg i { flex: 1 1 0; min-width: 0; overflow: hidden; background: var(--k); font-style: normal; font-size: 11px; font-weight: 900; line-height: 16px; text-align: center; color: var(--ink); }
.pp-seg i + i { border-left: 1.5px solid rgba(27, 29, 77, .35); }
.pp-unum { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--chunky); font-size: 13px; line-height: 1.15; white-space: nowrap; }
.pp-unum small { font-family: var(--round); font-weight: 900; font-size: 11px; color: #d97a00; }
.pp-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.pp-wlist { display: flex; flex-direction: column; margin: 0; padding: 0 0 0 1.6em; font-size: 14px; }
.pp-wlist li { padding: 3px 0; border-bottom: 1.5px dashed #e6dcc6; }
.pp-wlist li > * { margin-right: 8px; }
.pp-wlist b { font-family: var(--word); font-size: 16px; }
.pp-wlist span { color: #5b5e8f; }
.pp-wlist em { font-style: normal; font-weight: 900; color: #d9480f; white-space: nowrap; }
.pp-wlist i { font-style: normal; font-size: 12px; color: #d97a00; white-space: nowrap; }
.pp-llist { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pp-llist li { display: flex; flex-direction: column; align-items: center; min-width: 48px; padding: 3px 6px 5px; border: 2.5px solid var(--ink); border-radius: 14px; background: #fff1c4; box-shadow: 0 3px 0 var(--ink); }
.pp-llist b { font-family: var(--word); font-size: 24px; line-height: 1.1; }
.pp-llist small { font-size: 11px; font-weight: 900; color: #5b5e8f; white-space: nowrap; }
.pp-note, .pp-empty { margin: 0; font-size: 13px; color: #5b5e8f; }
.pp-range { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 900; }
.pp-range select { flex: 1; min-width: 0; max-width: 360px; height: 38px; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; font: inherit; font-family: var(--round); font-size: 14px; padding: 0 8px; color: var(--ink); }
.pp-todo .wl-sub { text-align: left; }
.pp-card .wl-actions { flex-wrap: wrap; }
.pp-card .wl-actions .big-btn { min-width: 0; padding: 0 16px; font-size: 18px; }
@media (max-width: 640px) {
  .pp-sec { padding: 10px 10px; }
  .pp-two { grid-template-columns: minmax(0, 1fr); }
  .pp-ulist li { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; }
  .pp-uname { grid-column: 1 / -1; }
  .pp-days i { width: 28px; height: 28px; }
  .pp-nums b { font-size: 20px; }
  .pp-card .wl-actions { flex-wrap: nowrap; gap: 6px; }
  .pp-card .wl-actions .sub-btn { flex: none; min-width: 0; height: 44px; padding: 0 12px; font-size: 15px; border-radius: 14px; }
  .pp-card .wl-actions .big-btn { flex: 1 1 0; min-width: 0; height: 44px; padding: 0 4px; font-size: 14px; white-space: nowrap; }
}
@media print {
  @page { size: A4; margin: 12mm; }
  html:has(> body.wl-print), body.wl-print { height: auto; overflow: visible; background: #fff; }
  body.wl-print > :not(#wordlist) { display: none !important; }
  body.wl-print #wordlist { position: static; display: block; padding: 0; background: none; }
  body.wl-print .wl-card { width: 100%; max-height: none; overflow: visible; padding: 0; border: none; border-radius: 0; box-shadow: none; background: #fff; color: #000; gap: 4px; }
  body.wl-print .wl-actions { display: none; }
  body.wl-print .wl-title { font-size: 16pt; }
  body.wl-print .wl-sub, body.wl-print .wl-unit h3 small, body.wl-print .wl-unit li span, body.wl-print .wl-unit li b, body.wl-print .wl-unit li i { color: #000; }
  body.wl-print .wl-unit { break-inside: avoid; }
  body.wl-print .wl-unit h3 { margin: 4px 0 2px; font-size: 11pt; border-bottom: 1px solid #000; }
  body.wl-print .wl-unit ul { columns: 4; column-gap: 10px; }
  body.wl-print .wl-unit li { font-size: 9pt; padding: 0; }
  body.wl-print .wl-unit li b { font-size: 10pt; }
  /* the parents' page prints only the chosen sheet */
  body.wl-print .pp-card > :not(.pp-todo), body.wl-print .pp-todo > :not(.wl-sheet):not(.dict-sheet) { display: none !important; }
  body.wl-print .pp-todo { display: block; padding: 0; border: none; box-shadow: none; background: none; }
  body.wl-print .print-only { display: block; }
  body.wl-print .wl-ptitle { margin: 0 0 2pt; font-family: var(--chunky); font-weight: 400; font-size: 15pt; text-align: center; }
  body.wl-print .wl-sheet .wl-sub { text-align: center; }
  body[data-wl-mode="dict"].wl-print .wl-sheet { display: none; }
  body:not([data-wl-mode="dict"]).wl-print .dict-sheet { display: none; }
  .ds-meta { display: flex; justify-content: center; gap: 18pt; margin: 0 0 6pt; font-size: 10pt; }
  /* up to 30 words (a unit): two roomy columns to write in; more words get smaller (a book still fits one page) */
  .ds-list { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 24pt; counter-reset: ds; font-size: 12pt; }
  .ds-list li { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 2pt 8pt; padding: 9pt 0 6pt; break-inside: avoid; counter-increment: ds; }
  .ds-list li::before { content: counter(ds) "."; min-width: 1.6em; font-size: .85em; }
  .ds-zh { font-weight: 900; }
  .ds-zh.none { font-weight: 400; font-size: .85em; }
  .ds-note { margin: 8pt 0 0; font-size: 9pt; }
  .ds-cells { display: inline-flex; flex-wrap: wrap; gap: 4pt 10pt; }
  .ds-cells b { display: inline-flex; gap: 4pt; font-weight: inherit; }
  .ds-cells i { display: inline-block; width: 15pt; height: 18pt; border-bottom: 1pt solid #000; font-style: normal; line-height: 18pt; text-align: center; }
  .ds-cells i.mk { width: auto; border: none; }
  .dict-sheet.mid .ds-list { columns: 3; column-gap: 14pt; font-size: 10.5pt; }
  .dict-sheet.mid .ds-list li { padding: 5pt 0 4pt; }
  .dict-sheet.mid .ds-cells { gap: 3pt 8pt; } .dict-sheet.mid .ds-cells b { gap: 3pt; }
  .dict-sheet.mid .ds-cells i { width: 11pt; height: 14pt; line-height: 14pt; }
  .dict-sheet.dense .ds-list { columns: 4; column-gap: 9pt; font-size: 9.5pt; }
  .dict-sheet.dense .ds-list li { padding: 3pt 0 3pt; gap: 1pt 5pt; }
  .dict-sheet.dense .ds-cells { gap: 2pt 6pt; } .dict-sheet.dense .ds-cells b { gap: 2.5pt; }
  .dict-sheet.dense .ds-cells i { width: 9pt; height: 12pt; line-height: 12pt; }
  /* answers upside down at the foot; the rule ends up on top once turned */
  .ds-ans { margin: 10pt 0 0; padding-bottom: 4pt; border-bottom: 1pt dashed #000; font-size: 6.5pt; line-height: 1.35; color: #444; transform: rotate(180deg); break-inside: avoid; }
  .ds-ans b { font-size: 7pt; }
}
}
.credit a { color: inherit; }
.voice-pick { flex: 1; min-width: 0; height: 40px; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; font: inherit; font-family: var(--round); font-size: 14px; padding: 0 8px; color: var(--ink); }
.ipick button { line-height: 1.25; }
.say-row { gap: 8px; } .say-row .voice-pick:disabled { opacity: .45; }
.uc-stars { font-size: 13px; color: #e79a00; letter-spacing: .02em; white-space: nowrap; }
.uc-rust { font-size: 12px; padding: 1px 6px; border-radius: 999px; background: #c98a4b; color: #fff; white-space: nowrap; }

/* ---------------------------------------------------------------- 萤光小语 logo: a light paper sticker */
.logo-firefly { --fs: clamp(58px, 16vw, 80px); position: relative; display: grid; justify-items: center; margin: calc(var(--fs) * .85) 0 calc(var(--fs) * .2); cursor: pointer; }
.lf-sticker { position: relative; display: block; font-size: var(--fs); padding: .16em .38em .22em; background: #fffaf0; border: 4px solid var(--ink); border-radius: .56em .44em .6em .5em; box-shadow: 0 7px 0 var(--ink); transform: rotate(-2deg); }
.lf-sticker::before { content: ""; position: absolute; inset: .07em; border: 3px dashed #ffd9a0; border-radius: .48em .38em .52em .42em; pointer-events: none; }
.lf-name { position: relative; display: flex; gap: .02em; font-family: "RHR Heavy", var(--chunky); font-weight: 900; line-height: 1.08; }
.lf-name i { font-style: normal; position: relative; display: inline-block; -webkit-text-stroke: .075em var(--ink); paint-order: stroke fill; text-shadow: 0 .07em 0 var(--ink); transform: rotate(var(--r, 0deg)) translateY(var(--dy, 0)); animation: lf-bob 2.8s ease-in-out infinite; }
.lf-name i:nth-child(1) { color: #ff7ab6; --r: -6deg; }
.lf-name i:nth-child(2) { color: #ffc93f; --r: 4deg; --dy: -.04em; animation-delay: -.7s; }
.lf-name i:nth-child(3) { color: #3fcfa0; --r: -3deg; --dy: .03em; animation-delay: -1.4s; }
.lf-name i:nth-child(4) { color: #5aa9ff; --r: 6deg; animation-delay: -2.1s; }
@keyframes lf-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -.04em; } }
.lf-light::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1.5em; height: 1.5em; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(255, 228, 110, .55), rgba(255, 228, 110, 0) 65%); z-index: -1; }
.lf-mascot { position: absolute; left: 50%; top: -.86em; width: .92em; height: auto; margin-left: -.46em; -webkit-text-stroke: 0; pointer-events: none; animation: lf-hover 2.6s ease-in-out infinite; }
@keyframes lf-hover { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-.08em) rotate(5deg); } }
.lf-dot { position: absolute; left: var(--x); top: var(--y); width: .1em; height: .1em; border-radius: 50%; background: #fff27a; box-shadow: 0 0 .12em .05em rgba(255, 220, 80, .9); pointer-events: none; animation: lf-dot 3s ease-in-out var(--d) infinite; }
@keyframes lf-dot { 0%, 100% { opacity: .25; transform: translate(0, 0); } 50% { opacity: 1; transform: translate(.1em, -.12em); } }
.lf-sub { margin-top: .4em; padding: .08em .8em .12em; font-family: "RHR Heavy", var(--chunky); font-size: calc(var(--fs) * .26); color: #fff; background: #3fcfa0; border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); -webkit-text-stroke: 0; }
.logo-firefly .logo-catch { margin-top: .5em; padding: .1em .9em .14em; font-family: "RHR Heavy", var(--chunky); font-size: calc(var(--fs) * .22); background: #ffd23f; color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); transform: rotate(-2deg); }
body.reduced .lf-name i, body.reduced .lf-mascot, body.reduced .lf-dot { animation: none; }
.credit { opacity: .75; }
.credit .chihaya { min-height: 0; padding: 0 6px; margin-left: 6px; border: none; background: none; box-shadow: none; animation: none; font-size: 14px; color: #ffb000; }

/* ---------------------------------------------------------------- 小萤 the flying guide */
.firefly { position: fixed; left: 0; top: 0; z-index: 9; pointer-events: none; will-change: transform; --lit: .4;
  filter: drop-shadow(0 0 calc(var(--lit) * 12px) rgba(255, 232, 100, .95)); }
.firefly svg { width: 100%; height: 100%; overflow: visible; }
.firefly .ff-halo { opacity: calc(.35 + var(--lit) * .55); }
.firefly .ff-wings { transform-box: fill-box; transform-origin: center; animation: ff-flap .13s ease-in-out infinite alternate; }
@keyframes ff-flap { to { transform: scaleY(.5); } }
body.reduced .firefly .ff-wings { animation: none; }
.pad .tk.next { box-shadow: 0 0 0 3px #ffe56b, 0 0 18px 4px rgba(255, 226, 90, .75); }

/* ---------------------------------------------------------------- title layout (萤光小语) */
/* Folded calendar: one line of badges; compact quest list. */
.cal-toggle { display: block; margin: 2px auto 0; padding: 4px 14px; font: inherit; font-family: var(--chunky); font-size: 13px; color: var(--ink); background: #fff; border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); cursor: pointer; }
.cal-card.collapsed { padding-bottom: 10px; }
.cal-card.collapsed .cal-week, .cal-card.collapsed .cal-grid, .cal-card.collapsed .cal-nav { display: none; }
.cal-card.collapsed .cal-head { justify-content: center; }
.cal-card.collapsed .cal-head h2 { font-size: 16px; }
.cal-card.collapsed .cal-badges { margin: 4px 0 6px; }
.cal-card:not(.collapsed) .cal-toggle { margin-top: 8px; }
#screen-title .quest-card { padding: 8px 10px 10px; }
#screen-title .quest-head h2 { font-size: 16px; }
#screen-title .quest-list { gap: 4px; }
#screen-title .quest-list li { font-size: 13.5px; padding: 4px 8px 7px 5px; grid-template-columns: 22px 1fr auto; }
/* Wide screens: logo + cats on the left, everything you press on the right, no scrolling. */
@media (min-width: 1000px) and (min-height: 600px) {
  #screen-title.is-active { grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); grid-template-rows: auto auto auto auto 1fr auto; column-gap: 44px; row-gap: 10px; align-content: center; padding-top: 18px; padding-bottom: 12px; padding-right: 72px; }
  #screen-title > #logo { grid-column: 1; grid-row: 1 / span 3; align-self: end; margin-bottom: 0; }
  #screen-title > .title-stage { grid-column: 1; grid-row: 4 / span 2; height: min(34vh, 290px); align-self: start; }
  #screen-title > .hello { grid-column: 2; grid-row: 1; justify-self: center; align-self: end; }
  #screen-title > .modes { grid-column: 2; grid-row: 2; width: 100%; align-self: start; gap: 8px; }
  #screen-title > .quest-card { grid-column: 2; grid-row: 3; max-width: none; width: 100%; align-self: start; }
  #screen-title > .cal-card { grid-column: 2; grid-row: 4; max-width: none; width: 100%; align-self: start; }
  #screen-title > .hint { display: none; }
  #screen-title > .credit { grid-column: 1 / -1; grid-row: 6; margin: 0; }
  #screen-title .big-btn { width: 100%; }
  #screen-title .big-btn.level-btn, #screen-title .challenge-btn { width: 100%; }
  #screen-title .modes .big-btn { padding-top: 8px; padding-bottom: 8px; }
  #screen-title .cal-card:not(.collapsed) .cal-day { min-height: 30px; aspect-ratio: 1 / .8; }
}

/* ---------------------------------------------------------------- title v2: hero + panel (2026-10-02) */
/* Phones keep the single column: the wrappers just pass their children through. */
.title-hero, .title-panel, .title-foot { display: contents; }
.title-hero > *, .title-panel > *, .title-foot > * { flex: none; }
@media (min-width: 1000px) and (min-height: 600px) {
  #screen-title.is-active { display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 470px); grid-template-rows: minmax(0, 1fr) auto; column-gap: 56px; row-gap: 8px; align-items: center; align-content: stretch; padding: 24px 76px 14px 28px; }
  .title-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; grid-column: 1; grid-row: 1; min-width: 0; }
  .title-hero > #logo { margin: 40px 0 0; --fs: clamp(58px, calc((100vw - 610px) / 5), 100px); }
  .title-hero > .title-stage { width: min(100%, 520px); height: min(36vh, 300px); margin-top: 8px; }
  .title-panel { display: flex; flex-direction: column; gap: 12px; grid-column: 2; grid-row: 1; width: 100%; align-self: center; }
  .title-panel > .hello { align-self: center; margin: 0; }
  .title-panel > .modes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; width: 100%; }
  .title-panel > .modes > *, .title-panel .mode-row > * { width: 100% !important; min-width: 0 !important; max-width: none !important; margin: 0 !important; }
  .title-panel > .modes [hidden] { display: none !important; }
  .title-panel #start { grid-column: 1 / -1; }
  .title-panel #open-tree, .title-panel #start-challenge { grid-column: span 3; font-size: 22px; padding: 10px 6px 12px; }
  .title-panel .modes:has(#start-challenge[hidden]) #open-tree { grid-column: 1 / -1; }
  .title-panel #open-tree small, .title-panel #start-challenge small { display: block; font-size: 12px; margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .title-panel .mode-row { display: contents; }
  .title-panel #start-review, .title-panel #open-trophy, .title-panel #open-collect { grid-column: span 2; height: 48px; padding: 0 6px; font-size: 16px; }
  .title-panel .modes:has(#start-review[hidden]) #open-trophy, .title-panel .modes:has(#start-review[hidden]) #open-collect { grid-column: span 3; }
  .title-panel #start-daily { grid-column: 1 / -1; height: 48px; min-height: 0; padding: 0 10px; font-size: 16px; display: flex; align-items: center; justify-content: center; }
  .title-panel #start-daily small { display: inline; margin-left: 12px; font-size: 12px; }
  .title-panel > .quest-card, .title-panel > .cal-card { width: 100%; max-width: none; margin: 0; }
  .title-foot { display: flex; justify-content: center; align-items: center; gap: 18px; grid-column: 1 / -1; grid-row: 2; }
  .title-foot > * { margin: 0 !important; }
  .title-foot > .hint { display: none; }
}

/* ---------------------------------------------------------------- settings: three columns on wide screens */
.set-cols, .set-col { display: contents; }
.set-col-title { display: none; }
@media (min-width: 900px) and (min-height: 560px) {
  #settings .modal-card { width: min(94vw, 1040px); max-height: calc(100dvh - 32px); padding: 20px 26px 22px; gap: 14px; }
  #settings .set-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 26px; align-items: start; }
  #settings .set-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  #settings .set-col + .set-col { padding-left: 26px; border-left: 2px dashed #e6dcc6; }
  #settings .set-col-title { display: block; margin: 0 0 2px; font-family: var(--chunky); font-size: 17px; color: var(--blue); }
  #settings .set-row { gap: 6px; }
  #settings .set-note { font-size: 12px; margin: 0; }
  #settings .ipick { flex-wrap: wrap; } #settings .ipick button { flex: 1 1 auto; padding: 8px 6px; font-size: 13px; }
  #settings #close-settings { margin-top: 4px; }
}
