/* Общие детали интерфейса: кнопки-таблички, плашки, окна из досок, списки */
#cv { position: absolute; left: 0; top: 0; display: block; z-index: 0; }
.screen { z-index: 2; }
.ic { width: 26px; height: 26px; flex-shrink: 0; display: block; }
button { font-family: inherit; border: none; background: none; color: inherit; outline: none; cursor: pointer; }
.col { display: flex; flex-direction: column; }
.row { display: flex; gap: 8px; width: 100%; }
.row > .btn, .row > .tgl { flex: 1; min-width: 0; }

/* --- кнопка-табличка --- */
.btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 48px; padding: 0 10px; border-radius: 13px; border: 3px solid #3a2410;
  font-size: 17px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
  box-shadow: 0 5px 0 #3a2410, 0 8px 8px rgba(0, 0, 0, 0.28); transition: transform 0.06s, box-shadow 0.06s;
}
.btn::before { content: ''; position: absolute; left: 5px; right: 5px; top: 3px; height: 38%; border-radius: 9px 9px 14px 14px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.06)); pointer-events: none; }
.btn::after { content: ''; position: absolute; left: 7px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: rgba(0, 0, 0, 0.3); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); pointer-events: none; }
.btn:active, .btn.down { transform: translateY(4px); box-shadow: 0 1px 0 #3a2410, 0 2px 3px rgba(0, 0, 0, 0.3); }
.btn .bl { white-space: nowrap; line-height: 1.05; }
.btn.wide { width: 100%; }
.btn.sq { flex: 0 0 52px !important; padding: 0; }
.btn.off { filter: grayscale(0.85) brightness(0.9); }
.b-play { background: linear-gradient(180deg, #a8f04a 0%, #52c22a 55%, #2f9a1e 100%); border-color: #17500e; box-shadow: 0 5px 0 #17500e, 0 8px 8px rgba(0, 0, 0, 0.28); }
.b-play .bl { display: flex; flex-direction: column; align-items: flex-start; }
.b-play b { font-size: 21px; letter-spacing: 1px; }
.b-play i { font-style: normal; font-size: 12px; font-weight: 800; color: #f2ffd8; max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.b-blue { background: linear-gradient(180deg, #6ec4ff, #2f7fe0); }
.b-orange { background: linear-gradient(180deg, #ffc04a, #f07a14); }
.b-red { background: linear-gradient(180deg, #ff7a62, #d8281e); }
.b-teal { background: linear-gradient(180deg, #5ee0c8, #189a8a); }
.b-pink { background: linear-gradient(180deg, #ff9ac8, #e0408a); }
.b-lime { background: linear-gradient(180deg, #e2f25a, #9ab818); }
.b-white { background: linear-gradient(180deg, #ffffff, #d8dce4); color: #3a2410; text-shadow: none; }
.dot { position: absolute; right: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #ff2a1e; border: 3px solid #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); display: none; animation: dotPulse 0.9s ease-in-out infinite; }
.dot.on { display: block; }
@keyframes dotPulse { 50% { transform: scale(1.25); } }

/* --- круглая кнопка --- */
.rbtn { width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; border: 3px solid #3a2410; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #ffc04a, #f07a14); box-shadow: 0 4px 0 #3a2410, 0 6px 6px rgba(0, 0, 0, 0.25); pointer-events: auto; }
.rbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #3a2410; }
.xbtn { position: absolute; right: 2px; top: 2px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 3px solid #3a2410; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #ff7a62, #d8281e); box-shadow: 0 3px 0 #3a2410; }
.xbtn .ic { width: 22px; height: 22px; }
.xbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #3a2410; }

/* --- плашки --- */
.plate { display: flex; align-items: center; gap: 5px; height: 38px; padding: 0 12px 0 6px; border-radius: 20px; border: 3px solid #3a2410; background: linear-gradient(180deg, #fff6dc, #f0d8a0); font-size: 18px; font-weight: 900; color: #4a2a08; box-shadow: 0 3px 0 #3a2410; white-space: nowrap; }
.plate .ic { width: 26px; height: 26px; }
.plate.bump { animation: bump 0.35s ease-out; }
@keyframes bump { 40% { transform: scale(1.22); } }

/* --- переключатель --- */
.tgl { position: relative; display: flex; align-items: center; gap: 7px; height: 46px; padding: 0 8px; border-radius: 13px; border: 3px solid #3a2410; background: linear-gradient(180deg, #8a6a4a, #6a4a2e); color: #fff; font-size: 15px; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); box-shadow: 0 4px 0 #3a2410; }
.tgl.wide { width: 100%; }
.tgl .bl { flex: 1; text-align: left; white-space: nowrap; }
.tgl .sw { position: relative; width: 44px; height: 24px; flex-shrink: 0; border-radius: 13px; background: #3a2410; border: 2px solid #22140a; transition: background 0.15s; }
.tgl .sw::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #c8b8a0; transition: transform 0.15s, background 0.15s; }
.tgl.on .sw { background: #3fa646; }
.tgl.on .sw::after { transform: translateX(20px); background: #fff; }
.tgl:active { transform: translateY(3px); box-shadow: 0 1px 0 #3a2410; }

/* --- окно: бумага в дощатой раме --- */
.overlay.dark { background: rgba(24, 40, 12, 0.6); }
.overlay.top { z-index: 60; }
.panel {
  position: relative; width: 336px; display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 34px 14px 16px; border-radius: 20px; border: 6px solid #9a6230;
  background: #fff6dc; background-image: repeating-linear-gradient(0deg, rgba(154, 98, 48, 0.07) 0 2px, transparent 2px 26px);
  box-shadow: 0 0 0 3px #4a2a10, inset 0 0 0 2px #c88a4a, 0 12px 0 rgba(0, 0, 0, 0.28);
  color: #4a2a08; animation: panelIn 0.28s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.panel::before, .panel::after { content: ''; position: absolute; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f4f6fa, #6a7078); box-shadow: 0 1px 0 #22242a; }
.panel::before { left: 5px; } .panel::after { right: 5px; }
@keyframes panelIn { from { opacity: 0; transform: scale(0.84) rotate(-2deg); } to { opacity: 1; transform: none; } }
.ribbon { position: absolute; left: 50%; top: -22px; transform: translateX(-50%) rotate(-1.5deg); min-width: 190px; max-width: 286px; padding: 6px 16px 7px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 20px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 #7a1410; background: linear-gradient(180deg, #ff6a52, #d8281e); border: 3px solid #7a1410; border-radius: 10px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
.ribbon::before, .ribbon::after { content: ''; position: absolute; top: 8px; width: 16px; height: 100%; background: #a81e14; border: 3px solid #7a1410; z-index: -1; }
.ribbon::before { left: -12px; border-radius: 6px 0 0 6px; } .ribbon::after { right: -12px; border-radius: 0 6px 6px 0; }
.p-small { width: 316px; }
.panel.px { padding-top: 46px; }
.panel.px .ribbon { left: 46%; max-width: 236px; min-width: 170px; font-size: 18px; }
.p-small .btn { font-size: 15px; }
.p-small .btn.sm { font-size: 13px; gap: 5px; }
.p-small .row .btn { font-size: 14px; padding: 0 6px; gap: 5px; }
.p-small .row .btn .ic, .p-small .btn.wide .ic { width: 22px; height: 22px; }
.p-list { width: 340px; }
.p-list .scroller { width: 100%; max-height: 380px; display: flex; flex-direction: column; gap: 7px; padding: 2px; }
.scroller { overflow-y: auto; scrollbar-width: none; }
.scroller::-webkit-scrollbar { display: none; }
.scroller.x { overflow-x: auto; overflow-y: hidden; white-space: nowrap; }
.list-full { flex: 1; min-height: 0; }

/* --- тост --- */
#toast { position: absolute; left: 50%; bottom: 13%; z-index: 80; max-width: 86%; transform: translate(-50%, 20px); padding: 9px 16px; border-radius: 13px; border: 3px solid #3a2410; background: #fff6dc; color: #4a2a08; font-size: 15px; font-weight: 900; text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --- рейтинг --- */
.lb-my { font-size: 15px; font-weight: 800; color: #6a4a2a; text-align: center; }
.lb-my b { color: #d8281e; font-size: 18px; }
#lb-list { overflow-y: auto; max-height: 320px; display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; border: 3px solid #b88a52; background: #fffaf0; font-size: 15px; font-weight: 800; color: #4a2a08; }
.lb-row.top-1 { background: linear-gradient(90deg, #fff0a0, #ffd84a); border-color: #b87a08; }
.lb-row.top-2 { background: linear-gradient(90deg, #f6f8fc, #cdd6e2); border-color: #7a8698; }
.lb-row.top-3 { background: linear-gradient(90deg, #ffe0c0, #f0a868); border-color: #a8582a; }
.lb-row.me { box-shadow: 0 0 0 3px #3fa646; }
.lb-medal { width: 30px; height: 30px; line-height: 30px; text-align: center; flex-shrink: 0; font-size: 13px; font-weight: 900; color: #6a4a2a; }
.lb-medal.gold, .lb-medal.silver, .lb-medal.bronze { border-radius: 50%; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); font-size: 16px; border: 2px solid #4a2a08; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6); }
.lb-medal.gold { background: radial-gradient(circle at 35% 30%, #fff3a0, #e89a08); }
.lb-medal.silver { background: radial-gradient(circle at 35% 30%, #fff, #8a98ac); }
.lb-medal.bronze { background: radial-gradient(circle at 35% 30%, #ffd0a0, #b05a22); }
.lb-avatar { position: relative; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #3a8ae8; color: #fff; font-weight: 900; border: 2px solid #4a2a08; }
.lb-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { flex-shrink: 0; color: #d8281e; font-weight: 900; }
.lb-empty { text-align: center; padding: 20px; font-size: 15px; font-weight: 800; color: #8a6a4a; }

/* --- карточки списков --- */
.card { position: relative; display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 13px; border: 3px solid #b88a52; background: #fffaf0; color: #4a2a08; flex-shrink: 0; }
.card .ic { width: 38px; height: 38px; }
.card .ct { flex: 1; min-width: 0; }
.card .cn { font-size: 15px; font-weight: 900; line-height: 1.15; }
.card .cd { font-size: 12px; font-weight: 700; color: #7a5a3a; line-height: 1.2; margin-top: 2px; }
.card .cr { flex-shrink: 0; display: flex; align-items: center; gap: 3px; font-size: 15px; font-weight: 900; color: #b8780a; }
.card .cr .ic { width: 20px; height: 20px; }
.card.done { background: linear-gradient(90deg, #e8ffd0, #c8f0a0); border-color: #3fa646; }
.card.done .cr { color: #2a8a2e; }
.card.dim { opacity: 0.72; }
.prog { position: relative; height: 10px; margin-top: 5px; border-radius: 6px; background: #d8c8a0; overflow: hidden; border: 1.5px solid #8a6a3a; }
.prog i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #a8f04a, #3fa646); }
.sbtn { flex-shrink: 0; min-width: 92px; height: 42px; padding: 0 8px; border-radius: 11px; border: 3px solid #3a2410; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 14px; font-weight: 900; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45); background: linear-gradient(180deg, #a8f04a, #3fa646); box-shadow: 0 3px 0 #3a2410; white-space: nowrap; }
.sbtn .ic { width: 20px; height: 20px; }
.sbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #3a2410; }
.sbtn.buy { background: linear-gradient(180deg, #ffd84a, #f09a14); }
.sbtn.no { background: linear-gradient(180deg, #c8c0b0, #8a8274); }
.sbtn.sel { background: linear-gradient(180deg, #6ec4ff, #2f7fe0); }
.sbtn.cur { background: none; border-color: transparent; box-shadow: none; color: #2a8a2e; text-shadow: none; }

/* --- подарок, подтверждение --- */
.daily-text { font-size: 15px; font-weight: 800; text-align: center; line-height: 1.3; color: #5a3a1a; }
.daily-days { display: flex; gap: 4px; width: 100%; justify-content: center; }
.dd { flex: 1; max-width: 40px; height: 54px; border-radius: 9px; border: 2.5px solid #b88a52; background: #fffaf0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 9px; font-weight: 900; color: #8a6a4a; white-space: nowrap; }
.dd b { font-size: 12px; color: #b8780a; }
.dd.got { background: #c8f0a0; border-color: #3fa646; }
.dd.now { background: linear-gradient(180deg, #fff0a0, #ffd84a); border-color: #b87a08; transform: scale(1.12); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); }
.pause-info { font-size: 14px; font-weight: 800; color: #6a4a2a; text-align: center; line-height: 1.35; }
