:root {
  --font: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --lcd: #b9d8a2;
  --lcd-2: #cbe4b5;
  --lcd-dark: #2c3d1e;
  --lcd-mid: #5f7a44;
  --body: #cdd3dc;
  --accent: #4a6da8;
  --key: #3d4653;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(120% 90% at 50% 0%, #f6f2ea 0%, #e7e2d6 60%, #ddd6c8 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.stage { width: 100%; display: flex; justify-content: center; }

/* ---------- корпус ---------- */
.phone {
  width: min(420px, 100%);
  padding: 18px 18px 22px;
  background: linear-gradient(160deg, #e6eaf0 0%, var(--body) 38%, #b7bfca 100%);
  border-radius: 32px 32px 42px 42px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.85),
    inset 0 -3px 0 rgba(60,70,85,.25),
    0 30px 44px -24px rgba(40,45,55,.55),
    0 2px 4px rgba(40,45,55,.25);
  position: relative;
}
.phone::before {
  content: ""; position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 52px; height: 5px; border-radius: 999px;
  background: #8f99a6; box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
}
.antenna {
  position: absolute; top: -24px; right: 42px; width: 12px; height: 32px; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(90deg, #9aa3ae, #d7dce2 45%, #8d96a2);
  box-shadow: 0 2px 4px rgba(40,45,55,.3);
}
.antenna::after { content: ""; position: absolute; top: 2px; left: 2px; right: 2px; height: 11px; border-radius: 4px; background: #59616c; }
.brand {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin: 8px 0 9px;
  font-size: 12px; font-weight: 900; letter-spacing: .3em; color: #6c7683;
}
.brand span { font-weight: 400; letter-spacing: .12em; font-size: 8px; color: #8b95a2; }

/* ---------- экран ---------- */
.screen-frame {
  padding: 9px 9px 10px;
  background: linear-gradient(180deg, #2b3038, #171a1f);
  border-radius: 16px 16px 11px 11px;
  box-shadow: inset 0 0 0 1px #0d0f12, 0 1px 0 rgba(255,255,255,.6);
}
.lcd {
  position: relative; overflow: hidden;
  border-radius: 7px;
  background:
    repeating-linear-gradient(0deg, rgba(44, 61, 30, .05) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #cbe4b5 0%, var(--lcd) 55%, #accb94 100%);
  color: var(--lcd-dark);
  font-family: var(--mono);
  box-shadow: inset 0 0 24px rgba(38, 54, 22, .26), inset 0 0 0 1px rgba(38, 54, 22, .4);
  display: flex; flex-direction: column;
}
.lcd-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 9px 4px; font-size: 9px; letter-spacing: .06em;
  border-bottom: 1px solid rgba(44, 61, 30, .25);
  flex: 0 0 auto;
}
.lcd-status .bar { display: flex; align-items: flex-end; gap: 1.5px; height: 9px; }
.lcd-status .bar i { width: 2.5px; background: var(--lcd-dark); border-radius: .5px; }
.lcd-status .bar i:nth-child(1) { height: 3px; } .lcd-status .bar i:nth-child(2) { height: 5px; }
.lcd-status .bar i:nth-child(3) { height: 7px; } .lcd-status .bar i:nth-child(4) { height: 9px; opacity: .3; }
.bat { display: inline-flex; align-items: center; }
.bat i {
  width: 12px; height: 7px; border: 1px solid var(--lcd-dark); border-radius: 1px; position: relative; display: block;
}
.bat i::before { content: ""; position: absolute; top: 1px; right: -2.5px; width: 1.5px; height: 3px; background: var(--lcd-dark); border-radius: 0 1px 1px 0; }
.bat i::after { content: ""; position: absolute; top: 1px; left: 1px; bottom: 1px; width: var(--charge, 60%); background: var(--lcd-dark); }

.lcd-view {
  height: 322px; overflow-y: auto; overflow-x: hidden;
  padding: 8px 10px 6px;
  display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: var(--lcd-mid) transparent;
  flex: 0 0 auto;
}
.lcd-view::-webkit-scrollbar { width: 5px; }
.lcd-view::-webkit-scrollbar-thumb { background: rgba(44,61,30,.35); border-radius: 4px; }

.lcd-soft {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 9px 6px; font-size: 9px; letter-spacing: .05em; font-weight: 700;
  border-top: 1px solid rgba(44, 61, 30, .22);
  flex: 0 0 auto;
}
.lcd-soft span:first-child { border-bottom: 1px solid var(--lcd-dark); }
.lcd-soft span:last-child { color: var(--lcd-mid); }

/* ---------- питомец ---------- */
.pet-stage { display: flex; flex-direction: column; align-items: center; padding-top: 4px; }
.pixel-pet { display: grid; grid-template-columns: repeat(12, 12px); margin: 2px 0 5px; }
.pixel-pet i { width: 12px; height: 12px; }
.pixel-pet .b { background: var(--lcd-dark); }
.pixel-pet .e { background: var(--lcd); }
.pixel-pet .m { background: #6b4326; }
.pixel-pet .p { background: rgba(120, 60, 40, .4); }
.pixel-pet.bob { animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.pet-name { font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.pet-name small { font-weight: 400; letter-spacing: .08em; opacity: .7; margin-left: 5px; }
.pet-level-line { font-size: 9px; color: var(--lcd-mid); margin-top: 2px; }

.stat-list { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.stat { display: grid; grid-template-columns: 58px 1fr 26px; align-items: center; gap: 7px; font-size: 8.5px; letter-spacing: .06em; }
.stat b { text-align: right; font-size: 8.5px; }
.stat-track { height: 8px; background: rgba(44, 61, 30, .16); border-radius: 2px; overflow: hidden; display: flex; gap: 2px; padding: 1px; }
.stat-fill { height: 100%; background: var(--lcd-dark); border-radius: 1px; }

.action-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 100%; margin-top: 10px; }
.lcd-btn {
  border: 1px solid rgba(44, 61, 30, .55); background: rgba(255,255,255,.18);
  border-radius: 5px; padding: 6px 4px; font-family: var(--mono);
  font-size: 8.5px; font-weight: 700; letter-spacing: .04em; cursor: pointer;
  color: var(--lcd-dark); display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.lcd-btn em { font-style: normal; font-size: 15px; line-height: 1; filter: grayscale(1) contrast(.8); }
.lcd-btn:hover { background: rgba(255,255,255,.35); }
.lcd-btn:active { transform: translateY(1px); }
.lcd-btn.is-off { opacity: .45; }

.home-hint {
  margin-top: 9px; font-size: 8.5px; color: var(--lcd-mid); text-align: center; line-height: 1.4;
}

/* ---------- меню ---------- */
.menu-list { display: flex; flex-direction: column; gap: 3px; }
.menu-row {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: 1px solid transparent; background: transparent; border-radius: 4px;
  padding: 6px 6px; font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .03em; cursor: pointer; text-align: left;
}
.menu-row em { font-style: normal; font-size: 14px; width: 18px; text-align: center; filter: grayscale(1) contrast(.85); }
.menu-row span { margin-left: auto; font-size: 8px; font-weight: 400; color: var(--lcd-mid); }
.menu-row:hover { border-color: rgba(44, 61, 30, .4); background: rgba(255,255,255,.2); }

.view-head {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 9px; letter-spacing: .12em; font-weight: 800; text-transform: uppercase;
  padding-bottom: 5px; margin-bottom: 6px; border-bottom: 1px dashed rgba(44, 61, 30, .4);
}
.view-head small { font-weight: 400; letter-spacing: .04em; text-transform: none; color: var(--lcd-mid); }

/* ---------- SMS ---------- */
.chat-thread { display: flex; flex-direction: column; gap: 5px; flex: 1; padding-bottom: 4px; max-height: 200px; overflow-y: auto; }
.msg { max-width: 86%; padding: 4px 6px; font-size: 9.5px; line-height: 1.35; border-radius: 4px; }
.msg.in { align-self: flex-start; background: rgba(44, 61, 30, .12); border: 1px solid rgba(44, 61, 30, .3); }
.msg.out { align-self: flex-end; background: var(--lcd-dark); color: var(--lcd); }
.msg small { display: block; font-size: 6.5px; opacity: .55; margin-top: 2px; }
.chat-input-row {
  display: flex; align-items: center; gap: 5px;
  border-top: 1px solid rgba(44, 61, 30, .35); padding-top: 5px;
}
.chat-input { flex: 1; min-height: 14px; font-size: 10px; letter-spacing: .04em; border-bottom: 1px solid var(--lcd-dark); }
.chat-input::after { content: "▌"; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chat-note { font-size: 7.5px; color: var(--lcd-mid); padding-top: 3px; }
.typing { font-size: 8.5px; color: var(--lcd-mid); padding-top: 2px; }

/* ---------- змейка ---------- */
.snake-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.snake-hud { display: flex; justify-content: space-between; width: 100%; font-size: 9px; letter-spacing: .08em; }
.snake-grid {
  display: grid; grid-template-columns: repeat(12, 15px); grid-template-rows: repeat(12, 15px);
  gap: 1px; padding: 4px; border: 1px solid rgba(44, 61, 30, .5); border-radius: 3px;
  background: rgba(255,255,255,.12);
}
.snake-cell { background: rgba(44, 61, 30, .07); border-radius: 1px; }
.snake-cell.snake { background: var(--lcd-dark); }
.snake-cell.head { background: var(--lcd-dark); box-shadow: inset 0 0 0 1px var(--lcd); }
.snake-cell.food { background: #7a4a2a; border-radius: 50%; }
.snake-msg { font-size: 8.5px; text-align: center; color: var(--lcd-mid); line-height: 1.4; }
.snake-field { position: relative; display: inline-block; }
.snake-pet {
  position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 2;
  pointer-events: none; transition: transform .6s linear;
}
.snake-pet .pixel-pet { margin: 0; transform: scale(.16); transform-origin: top left; animation: petbob .9s ease-in-out infinite; }
@keyframes petbob { 50% { transform: scale(.16) translateY(-7px); } }

/* ---------- анимации питомца ---------- */
.pet-stage { position: relative; }
.pixel-pet.act-eat { animation: chew .3s ease-in-out 4; }
@keyframes chew { 50% { transform: scaleY(.82) translateY(3px); } }
.pixel-pet.act-play { animation: hop .34s ease-in-out 4; }
@keyframes hop { 50% { transform: translateY(-9px); } }
.pixel-pet.act-pet { animation: wiggle .36s ease-in-out 3; }
@keyframes wiggle { 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
.pixel-pet.is-sleeping { animation: snooze 3.2s ease-in-out infinite; transform-origin: bottom center; }
@keyframes snooze { 0%,100% { transform: rotate(-5deg) translateY(4px); } 50% { transform: rotate(-5deg) translateY(1px); } }
.zzz { position: absolute; top: 16px; right: 20px; display: flex; align-items: flex-end; gap: 2px; color: var(--lcd-mid); font-family: var(--mono); font-weight: 800; pointer-events: none; }
.zzz span { animation: zfloat 2.4s ease-in-out infinite; font-size: 11px; }
.zzz span:nth-child(2) { animation-delay: .4s; font-size: 8px; }
.zzz span:nth-child(3) { animation-delay: .8s; font-size: 6px; }
@keyframes zfloat { 0% { opacity: 0; transform: translate(0, 4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -16px); } }
.float-emoji { position: absolute; top: 46%; z-index: 4; font-size: 15px; pointer-events: none; animation: floatUp 1.1s ease-out forwards; }
@keyframes floatUp { to { transform: translateY(-48px) scale(1.3); opacity: 0; } }

/* ---------- мячик ---------- */
.ball-field {
  position: relative; height: 238px; margin-top: 2px;
  border: 1px solid rgba(44, 61, 30, .5); border-radius: 5px; overflow: hidden;
  background:
    radial-gradient(140% 80% at 50% 100%, rgba(255, 255, 255, .28), transparent 60%),
    repeating-linear-gradient(0deg, rgba(44, 61, 30, .07) 0 1px, transparent 1px 26px),
    linear-gradient(180deg, #cbe4b5 0%, #b9d8a2 55%, #a8c98f 100%);
  cursor: crosshair; touch-action: manipulation;
}
.ball-field::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .04));
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
  opacity: .5;
}
.ball-hud { position: absolute; top: 6px; left: 8px; right: 8px; display: flex; justify-content: space-between; font-size: 8px; letter-spacing: .08em; color: var(--lcd-dark); z-index: 3; }
.ball-hint { position: absolute; top: 20px; left: 0; right: 0; text-align: center; font-size: 7.5px; color: var(--lcd-mid); pointer-events: none; }
.ball-ring {
  position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border: 2px dashed rgba(44, 61, 30, .7); border-radius: 50%;
  animation: ringPulse 1.5s ease-in-out infinite; pointer-events: none;
}
@keyframes ringPulse { 50% { transform: scale(1.12); opacity: .5; } }
.pet-runner {
  position: absolute; left: 50%; bottom: 4px; z-index: 2;
  transform: translateX(-50%) scale(.55); transform-origin: bottom center;
  transition: transform .65s cubic-bezier(.4, 0, .2, 1);
}
.pet-runner .pixel-pet { margin: 0; animation: none; }
.pet-runner.is-running .pixel-pet { animation: runbob .26s ease-in-out infinite; }
@keyframes runbob { 50% { transform: translateY(-4px); } }
.ball-toy {
  position: absolute; left: 50%; top: 204px; transform: translate(-50%, -50%);
  font-size: 20px; z-index: 3; transition: left .32s ease-out, top .32s ease-out, font-size .3s;
  pointer-events: none;
}

/* ---------- повтори мелодию ---------- */
.simon-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.simon-hud { display: flex; justify-content: space-between; width: 100%; font-size: 9px; letter-spacing: .06em; }
.simon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 210px; }
.simon-key {
  height: 62px; border-radius: 8px; border: 1px solid rgba(44, 61, 30, .6);
  font-family: var(--mono); font-size: 16px; font-weight: 800; color: rgba(44, 61, 30, .75);
  cursor: pointer; opacity: .68;
  transition: opacity .1s, transform .1s, box-shadow .1s;
}
.simon-key.k1 { background: #a9d18e; }
.simon-key.k2 { background: #e8a9a0; }
.simon-key.k3 { background: #e5d18a; }
.simon-key.k4 { background: #9fb9d9; }
.simon-key.lit { opacity: 1; transform: scale(.97); box-shadow: inset 0 0 0 3px var(--lcd-dark), 0 0 14px rgba(44, 61, 30, .45); }
.simon-msg { font-size: 9px; text-align: center; color: var(--lcd-mid); min-height: 24px; line-height: 1.4; }

/* ---------- магазин ---------- */
.shop-cat { font-size: 8px; letter-spacing: .12em; text-transform: uppercase; color: var(--lcd-mid); margin: 7px 0 3px; }
.shop-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 4px; border-bottom: 1px solid rgba(44, 61, 30, .18);
}
.shop-item:last-child { border-bottom: 0; }
.shop-ico { width: 20px; height: 20px; border-radius: 4px; border: 1px solid rgba(44,61,30,.5); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex: 0 0 auto; background: rgba(255,255,255,.2); }
.shop-name { font-size: 9px; font-weight: 700; line-height: 1.2; }
.shop-sub { font-size: 7.5px; color: var(--lcd-mid); }
.shop-price { margin-left: auto; font-size: 9px; font-weight: 700; white-space: nowrap; }
.shop-buy {
  border: 1px solid rgba(44,61,30,.55); background: rgba(255,255,255,.25); border-radius: 4px;
  padding: 3px 6px; font-family: var(--mono); font-size: 8px; font-weight: 700; cursor: pointer;
}
.shop-buy:active { transform: translateY(1px); }
.shop-owned { font-size: 7.5px; color: var(--lcd-mid); white-space: nowrap; }

/* ---------- задания ---------- */
.quest {
  display: flex; align-items: center; gap: 7px; padding: 6px 3px;
  border-bottom: 1px solid rgba(44, 61, 30, .18);
}
.quest:last-child { border-bottom: 0; }
.quest-main { min-width: 0; flex: 1; }
.quest-title { font-size: 9px; font-weight: 700; }
.quest-bar { height: 5px; background: rgba(44, 61, 30, .16); border-radius: 3px; margin-top: 3px; overflow: hidden; }
.quest-fill { height: 100%; background: var(--lcd-dark); border-radius: 3px; }
.quest-reward { font-size: 8px; color: var(--lcd-mid); margin-top: 2px; }
.quest-claim {
  border: 1px solid rgba(44,61,30,.55); background: rgba(255,255,255,.25); border-radius: 4px;
  padding: 3px 6px; font-family: var(--mono); font-size: 8px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.quest-claim[disabled] { opacity: .4; cursor: default; }
.streak-line { display: flex; gap: 10px; font-size: 8.5px; color: var(--lcd-mid); margin-top: 8px; }

/* ---------- друзья ---------- */
.friend {
  display: flex; align-items: center; gap: 8px; padding: 6px 3px;
  border-bottom: 1px solid rgba(44, 61, 30, .18);
}
.friend-ava { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.35); border: 1px solid rgba(44,61,30,.4); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.friend-name { font-size: 9.5px; font-weight: 700; }
.friend-sub { font-size: 7.5px; color: var(--lcd-mid); }
.visit-box { margin-top: 8px; padding: 6px; border: 1px dashed rgba(44,61,30,.5); border-radius: 4px; }
.visit-title { font-size: 9px; font-weight: 700; margin-bottom: 2px; }
.visit-sub { font-size: 8px; color: var(--lcd-mid); line-height: 1.4; }
.visit-actions { display: flex; gap: 4px; margin-top: 6px; }
.visit-actions .lcd-btn { flex: 1; }
.invite-box { margin-top: 8px; font-size: 8px; color: var(--lcd-mid); word-break: break-all; line-height: 1.5; }
.invite-box code { font-size: 7.5px; color: var(--lcd-dark); }

/* ---------- стикеры ---------- */
.sticker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.sticker {
  aspect-ratio: 1; border: 1px solid rgba(44, 61, 30, .4); border-radius: 5px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 17px; background: rgba(255,255,255,.22);
}
.sticker small { font-size: 6.5px; font-family: var(--mono); color: var(--lcd-mid); }
.sticker.locked { opacity: .38; }
.sticker.owned { box-shadow: inset 0 0 0 1px var(--lcd-dark); }

/* ---------- профиль/настройки ---------- */
.kv { display: flex; justify-content: space-between; font-size: 9px; padding: 5px 2px; border-bottom: 1px solid rgba(44,61,30,.18); }
.kv:last-child { border-bottom: 0; }
.kv b { font-weight: 700; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px; border-bottom: 1px solid rgba(44,61,30,.18); font-size: 9px; }
.settings-row:last-child { border-bottom: 0; }
.toggle {
  border: 1px solid rgba(44,61,30,.55); background: rgba(255,255,255,.2); border-radius: 999px;
  width: 34px; height: 17px; padding: 1px; display: flex; align-items: center; cursor: pointer; justify-content: flex-start;
}
.toggle i { width: 13px; height: 13px; border-radius: 50%; background: var(--lcd-mid); display: block; }
.toggle.on { justify-content: flex-end; background: var(--lcd-dark); }
.toggle.on i { background: var(--lcd); }
.select-lcd {
  font-family: var(--mono); font-size: 8.5px; color: var(--lcd-dark);
  background: rgba(255,255,255,.25); border: 1px solid rgba(44,61,30,.5); border-radius: 4px;
  padding: 2px 3px;
}
.danger-btn { border-color: #7a3f36 !important; color: #6d342c !important; }

/* ---------- онбординг ---------- */
.onboard { display: flex; flex-direction: column; gap: 8px; }
.onboard h3 { font-size: 11px; margin: 0; letter-spacing: .05em; }
.onboard p { font-size: 8.5px; line-height: 1.45; color: var(--lcd-mid); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  border: 1px solid rgba(44,61,30,.5); background: rgba(255,255,255,.2); border-radius: 999px;
  padding: 3px 8px; font-family: var(--mono); font-size: 8.5px; cursor: pointer;
}
.chip.is-on { background: var(--lcd-dark); color: var(--lcd); }
.panel-swatches { display: flex; gap: 6px; }
.swatch {
  width: 32px; height: 22px; border-radius: 4px; border: 1px solid rgba(44,61,30,.5); cursor: pointer;
  background: linear-gradient(145deg, var(--c1), var(--c2));
}
.swatch.is-on { outline: 2px solid var(--lcd-dark); outline-offset: 1px; }
.onboard-go { margin-top: 2px; }
.onboard-name-input {
  width: 100%; font-family: var(--mono); font-size: 9px; padding: 4px 6px;
  border: 1px solid rgba(44,61,30,.5); border-radius: 4px; background: rgba(255,255,255,.25);
  color: var(--lcd-dark); outline: none;
}

/* ---------- клавиши ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; margin: 13px 4px 11px; }
.softkey {
  width: 68px; height: 17px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #eef1f5, #b8c0cb);
  box-shadow: 0 2px 0 #8d96a2, inset 0 1px 0 #fff;
  font-size: 7.5px; font-weight: 800; letter-spacing: .08em; color: #4b5563; cursor: pointer;
}
.softkey:active { transform: translateY(1px); box-shadow: 0 1px 0 #8d96a2, inset 0 1px 0 #fff; }
.dpad { width: 92px; height: 64px; position: relative; }
.dpad .ring { position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(160deg, #eef1f5, #aab3bf); box-shadow: inset 0 1px 0 #fff, 0 3px 0 #808a96; }
.dpad .center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 30px; border-radius: 9px; border: 0;
  background: linear-gradient(180deg, #d9dee5, #9aa4b0);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 #7c8794; cursor: pointer;
  font-size: 8px; font-weight: 800; color: #4b5563;
}
.dpad .arrow {
  position: absolute; font-size: 10px; color: #5c6672; background: none; border: 0; cursor: pointer; padding: 6px; line-height: 1;
}
.dpad .arrow.up { top: -3px; left: 50%; transform: translateX(-50%); }
.dpad .arrow.down { bottom: -3px; left: 50%; transform: translateX(-50%); }
.dpad .arrow.left { left: -3px; top: 50%; transform: translateY(-50%); }
.dpad .arrow.right { right: -3px; top: 50%; transform: translateY(-50%); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.key {
  border: 0; border-radius: 9px; padding: 6px 2px 5px;
  background: linear-gradient(180deg, #59636f, var(--key) 55%, #2b313a);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 2px 0 #20252c;
  color: #eef1f4; cursor: pointer; line-height: 1.05;
}
.key:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 0 #20252c; }
.key b { display: block; font-size: 13px; font-weight: 700; }
.key span { display: block; font-size: 5.8px; letter-spacing: .1em; color: #c3cad3; margin-top: 1px; }
.key-row-special { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 7px; }
.special {
  border: 0; border-radius: 9px; height: 28px;
  background: linear-gradient(180deg, #7d8794, #4d5661);
  color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .04em; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 0 #2a2f36;
}
.special:active { transform: translateY(1px); }

/* ---------- оверлей и тост ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 24, 16, .55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.sheet {
  width: min(360px, 100%); background: var(--lcd); color: var(--lcd-dark);
  border-radius: 12px; border: 2px solid var(--lcd-dark);
  padding: 16px; font-family: var(--mono); box-shadow: 0 24px 60px -20px rgba(0,0,0,.6);
}
.sheet h3 { margin: 0 0 6px; font-size: 12px; letter-spacing: .06em; }
.sheet p { margin: 0 0 12px; font-size: 9.5px; line-height: 1.5; }
.sheet-actions { display: flex; gap: 6px; justify-content: flex-end; }
.sheet .lcd-btn { padding: 7px 10px; font-size: 9px; }
.sheet .lcd-btn--primary { background: var(--lcd-dark); color: var(--lcd); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #1d2118; color: #e9f0dd; font-family: var(--mono); font-size: 10px;
  padding: 9px 14px; border-radius: 999px; z-index: 60;
  box-shadow: 0 14px 30px -12px rgba(0,0,0,.5);
}

@media (max-width: 430px) {
  body { padding: 8px; }
  .phone { padding: 14px 14px 18px; border-radius: 26px 26px 34px 34px; }
  .lcd-view { height: 300px; }
  .brand { font-size: 10.5px; }
  .softkey { width: 60px; }
}
@media (max-height: 760px) {
  .lcd-view { height: 262px; }
  .phone { padding-top: 14px; }
  .nav { margin: 10px 4px 9px; }
}
