/* dailytoolshelf — mobile-first, plain CSS, no framework */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #1f2430;
  line-height: 1.55;
}
a { color: #2563eb; text-decoration: none; }
button, input, textarea { font: inherit; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 48px; }

/* header：吸顶，滚动时一直能看到登录/注册；半透明 + 毛玻璃，内容从下面滑过时不穿帮 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px; max-width: 720px; margin: 0 auto;
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 247, 249, .92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}
.brand { font-size: 19px; font-weight: 700; color: #1f2430; }
.brand small { display: block; font-size: 12px; font-weight: 400; color: #6b7280; }
.auth-area { font-size: 14px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.auth-area .who { color: #374151; font-weight: 600; }
.link-btn {
  background: none; border: none; color: #2563eb; cursor: pointer; padding: 6px 2px; font-size: 14px;
}

/* cards / shelf：白底 + 细边 + 柔和阴影，圆角 16px；点按有轻微缩放反馈 */
.card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 16px;
  padding: 18px; margin: 14px 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
  transition: box-shadow .15s ease, transform .15s ease, background .15s ease;
}
/* 首页头图区：只放一句话，不堆装饰 */
.hero { padding: 28px 4px 4px; }
.hero h1 { font-size: 26px; line-height: 1.3; letter-spacing: -.5px; margin: 0 0 8px; }
.hero p { margin: 0; color: #6b7280; font-size: 15px; line-height: 1.6; }
/* 分区小标题：标题 + 一条细线把各区隔开 */
.section-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; color: #374151; margin: 30px 0 2px;
}
.section-head::after { content: ''; flex: 1; height: 1px; background: #e5e7eb; }
/* 产品卡：图标 + 文字 + 右箭头，一眼能分清是哪个 */
.product { display: flex; align-items: center; gap: 14px; color: inherit; }
.product h2 { margin: 0 0 3px; font-size: 17px; }
.product p { margin: 0; color: #6b7280; font-size: 14px; text-wrap: balance; word-break: keep-all; }
.p-icon {
  flex: none; width: 48px; height: 48px; border-radius: 14px;
  background: var(--ac-bg, #eef1f5); color: var(--ac, #2563eb);
  display: flex; align-items: center; justify-content: center;
}
.p-icon svg { width: 26px; height: 26px; }
.p-text { flex: 1; min-width: 0; }
.p-go { flex: none; color: #6b7280; display: flex; align-items: center; }
.p-go svg { width: 20px; height: 20px; display: block; }
@media (hover: hover) {
  .product:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, .08); }
}
.product:active { transform: scale(.99); background: #fafbfc; }
.badge {
  display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px;
  background: #e8f5e9; color: #2e7d32; margin-left: 8px; vertical-align: 2px;
}
.badge.soon { background: #f1f1f4; color: #8a8f98; }
.badge.out { background: #fdecea; color: #c62828; }
.badge.cat { background: #eef1f5; color: #374151; }
.cur { color: #6b7280; font-size: 12px; font-weight: 400; }

/* ledger rows */
.ledger-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eceef1; }
.ledger-row:last-child { border-bottom: none; }
.ledger-meta { color: #6b7280; font-size: 13px; margin-top: 2px; }
/* 共享账本列表：紧凑可折叠行（账本多时一行只占一格，点开才看分享码/成员） */
.ledger-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  width: 100%; padding: 12px 0; background: transparent; border: none; border-bottom: 1px solid #eceef1;
  font-family: inherit; font-size: 16px; color: #1f2430; text-align: left; cursor: pointer;
}
.ledger-head strong { flex: 1; min-width: 0; text-align: left; }
.ledger-head .chev { color: #9ca3af; font-size: 18px; transition: transform .15s ease; flex: none; }
.ledger-head.open .chev { transform: rotate(90deg); }
.ledger-detail { padding: 12px 0; border-bottom: 1px solid #eceef1; }
.ledger-amount { font-weight: 700; white-space: nowrap; }
.ledger-amount.in { color: #2e7d32; }
.ledger-amount.out { color: #c62828; }
.product.disabled { opacity: .65; }

.section-title { font-size: 17px; margin: 22px 0 4px; }
.hint { color: #6b7280; font-size: 13px; }
.error { color: #c62828; font-size: 14px; min-height: 20px; }
.ok-msg { color: #2e7d32; font-size: 14px; min-height: 20px; }

/* 使用说明（details 折叠卡片）：默认收起一行，点开看 */
details.card summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.help-list { margin: 10px 0 0; padding-left: 20px; font-size: 14px; color: #374151; }
.help-list li { margin: 6px 0; line-height: 1.6; }

/* forms */
label { display: block; font-size: 14px; color: #374151; margin: 12px 0 5px; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="search"], textarea {
  width: 100%; max-width: 100%; min-width: 0; padding: 12px; border: 1px solid #d1d5db; border-radius: 10px;
  background: #fff; font-size: 16px; /* 16px avoids iOS zoom-on-focus */
  /* min-width: 0 防止 iOS 上日期输入框按自身内容宽度把边框撑出卡片 */
}
select {
  width: 100%; max-width: 100%; min-width: 0; padding: 12px; border: 1px solid #d1d5db; border-radius: 10px;
  background: #fff; font-size: 16px;
}
/* 两个并排的下拉框（如记账的货币/分类）：子项 min-width: 0 才能在窄屏收窄 */
.form-row { display: flex; gap: 10px; }
.form-row > div { flex: 1; min-width: 0; }
input[type="range"] { width: 100%; }
/* iOS Safari 上 <input type="date"> 不认 box-sizing：实测在 390px 宽手机上会把 12px 内边距 + 1px 边框
   加到 100% 宽度外面，右侧超出卡片约 26px（其他输入框都正常）。只在 iOS 上把宽度收掉 26px 抵消；
   -webkit-touch-callout 只在 iOS Safari 上支持，所以这条不影响桌面和其他浏览器。 */
@supports (-webkit-touch-callout: none) {
  input[type="date"] { width: calc(100% - 26px); }
}
/* 记账日期框：原生 <input type="date"> 的显示格式跟手机系统语言走，不跟网站语言
   （中文手机上英文版仍显示“2026年12月4日”）。所以用一层自定义显示盖在上面，
   按网站语言格式化（中文 2026年12月4日 / 英文 12/04/2026）；真正的 date 框透明
   盖满整块，点它仍弹出原生日期选择器，选完回填显示。opacity:0 不影响点按，
   不要用 display:none / visibility:hidden（那样点不开选择器）。 */
.date-field { position: relative; }
.date-field .date-display {
  display: block; box-sizing: border-box; width: 100%; padding: 12px;
  border: 1px solid #d1d5db; border-radius: 10px; background: #fff;
  font-size: 16px; text-align: center; min-height: 48px; line-height: 24px;
}
.date-field input[type="date"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: none; padding: 0; margin: 0; box-sizing: border-box;
}
/* 英文版自绘日期选择器（见 ledger.html 注释）：底部弹出式日历，点遮罩或 Done 关闭。
   只在英文版启用；中文版仍用原生 iOS 选择器。 */
.date-picker { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.35); }
.date-picker[hidden] { display: none; }
.dp-panel { width: 100%; max-width: 420px; background: #fff; border-radius: 16px 16px 0 0; padding: 10px 16px 22px; box-sizing: border-box; }
.dp-head { display: flex; align-items: center; justify-content: space-between; font-size: 17px; font-weight: 600; }
.dp-head button { background: none; border: none; font-size: 30px; line-height: 1; color: #2563eb; padding: 2px 14px; cursor: pointer; }
.dp-head button:disabled { color: #d1d5db; cursor: default; }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.dp-week { font-size: 13px; color: #6b7280; margin-top: 6px; }
.dp-week span { padding: 6px 0; }
.dp-grid button { justify-self: center; width: 40px; height: 40px; border-radius: 50%; background: none; border: none; font-size: 17px; padding: 0; cursor: pointer; }
.dp-grid button.today { color: #2563eb; font-weight: 700; }
.dp-grid button.sel { background: #2563eb; color: #fff; }
.dp-grid button.sel.today { color: #fff; }
.dp-grid button:disabled { color: #d1d5db; cursor: default; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 10px; }
.dp-foot button { background: none; border: none; font-size: 17px; color: #2563eb; padding: 8px 4px; cursor: pointer; }
textarea { min-height: 84px; resize: vertical; }
.btn {
  display: inline-block; width: 100%; padding: 13px; margin-top: 16px;
  background: #2563eb; color: #fff; border: none; border-radius: 10px;
  font-size: 16px; font-weight: 600; cursor: pointer; min-height: 48px;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .25);
  transition: transform .12s ease, background .12s ease;
}
.btn:active { background: #1d4ed8; transform: scale(.98); }
.btn.secondary { background: #eef1f5; color: #1f2430; }
.btn.danger { background: #fff; color: #c62828; border: 1px solid #e5b4b4; }
.btn.small { width: auto; padding: 8px 14px; font-size: 14px; min-height: 40px; margin-top: 0; }
.tabs { display: flex; gap: 8px; margin-bottom: 6px; }
.tabs button {
  flex: 1; padding: 11px; border-radius: 10px; border: 1px solid #d1d5db;
  background: #fff; cursor: pointer; font-size: 15px; min-height: 46px;
}
.tabs button.active { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600; }

/* habit tracker */
.habit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.habit-head h3 { margin: 0; font-size: 17px; }
.stats { color: #6b7280; font-size: 13px; margin-top: 3px; }
.stats b { color: #2e7d32; }
.del-btn { background: none; border: none; color: #b0b5bd; font-size: 13px; cursor: pointer; padding: 4px; }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 8px; }
.month-nav .m { font-weight: 600; font-size: 15px; }
.month-nav button {
  border: 1px solid #d1d5db; background: #fff; border-radius: 8px;
  width: 40px; height: 40px; font-size: 17px; cursor: pointer;
}
.cal { width: 100%; border-collapse: separate; border-spacing: 3px; }
.cal th { font-size: 12px; color: #9aa0aa; font-weight: 400; padding: 2px 0; }
.cal td {
  text-align: center; padding: 0; height: 42px; border-radius: 9px;
  font-size: 14px; color: #374151; background: #f3f4f6; position: relative;
}
.cal td.empty { background: transparent; }
.cal td.checked { background: #43a047; color: #fff; font-weight: 700; }
.cal td.today { outline: 2px solid #2563eb; outline-offset: -2px; }
.cal td.tappable { cursor: pointer; }
.cal td.dim { color: #c3c8cf; }

/* habit stats (by category) */
.stat-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #eceef1; font-size: 14px; }
.stat-row:last-child { border-bottom: none; }
.stat-name { width: 64px; flex: none; }
.stat-bar-wrap { flex: 1; min-width: 0; background: #f3f4f6; border-radius: 999px; height: 10px; overflow: hidden; }
.stat-bar { display: block; height: 100%; background: #43a047; border-radius: 999px; }
.stat-num { flex: none; text-align: right; color: #6b7280; font-size: 13px; white-space: nowrap; }
.cat-select { width: auto; min-width: 0; display: inline-block; font-size: 13px; padding: 4px 6px; border-radius: 8px; }

/* ledger stats page */
.stat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.stat-tile { background: #f8fafc; border: 1px solid #eceef1; border-radius: 12px; padding: 12px; }
.stat-tile .t-label { font-size: 13px; color: #6b7280; }
.stat-tile .t-value { font-size: 20px; font-weight: 700; margin-top: 2px; }
.stat-tile .t-value.in { color: #2e7d32; }
.stat-tile .t-value.out { color: #c62828; }
.stat-tile .t-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.donut-wrap { display: flex; justify-content: center; padding: 8px 0 4px; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #eceef1; font-size: 14px; }
.legend-row:last-child { border-bottom: none; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.daily-bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding-top: 8px; }
.daily-bar { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.daily-bar .bar { width: 100%; max-width: 18px; background: #2563eb; border-radius: 3px 3px 0 0; }
.daily-bar.max .bar { background: #c62828; }
.daily-bar .d-label { font-size: 10px; color: #9ca3af; margin-top: 4px; height: 12px; }

/* admin table */
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #eceef1; vertical-align: top; }
.fb-text { white-space: pre-wrap; word-break: break-word; }

footer { text-align: center; color: #9aa0aa; font-size: 12px; padding: 10px 0 26px; }

@media (min-width: 640px) {
  .cal td { height: 50px; font-size: 15px; }
}

/* 每日密码锁 */
.code-grid { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 6px; }
.code-row { display: flex; gap: 8px; justify-content: center; }
.code-cell {
  width: 56px; height: 56px; border: 2px solid #d1d5db; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; color: #1f2430; background: #fff;
}
.code-cell.filled { border-color: #9aa0aa; }
.code-cell.fb-hit { background: #2563eb; border-color: #2563eb; color: #fff; }
.code-cell.fb-present { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.code-cell.fb-miss { background: #e5e7eb; border-color: #e5e7eb; color: #6b7280; }
.legend-hit { color: #2563eb; font-weight: 700; }
.legend-present { color: #d97706; font-weight: 700; }
.keypad {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px;
}
.key {
  padding: 13px 0; border-radius: 10px; border: 1px solid #d1d5db;
  background: #f3f4f6; cursor: pointer; font-size: 19px; font-weight: 600;
  min-height: 52px; color: #1f2430;
}
.key.wide { grid-column: span 2; }
.key.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.key-hit { background: #2563eb; border-color: #2563eb; color: #fff; }
.key-present { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.key-miss { background: #e5e7eb; border-color: #e5e7eb; color: #9aa0aa; }
.share-text {
  white-space: pre-wrap; word-break: break-word; background: #f3f4f6;
  border-radius: 10px; padding: 12px; font-size: 15px; line-height: 1.6; margin: 8px 0;
}

/* 每日三消 */
.trio-board { position: relative; width: 100%; aspect-ratio: 342 / 197; margin: 14px 0 6px; }
.trio-tile {
  position: absolute; border: 2px solid rgba(0, 0, 0, .08); border-radius: 10px;
  cursor: pointer; padding: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1.2;
}
.trio-tile .trio-emoji { font-size: 22px; }
.trio-tile .trio-name { font-size: 10px; color: #6b7280; }
.trio-tile.blocked { opacity: .55; }
.trio-tile:active { transform: scale(.94); }
.trio-tray { display: flex; gap: 6px; justify-content: center; margin: 12px 0 4px; }
.trio-slot {
  flex: 1 1 0; min-width: 0; max-width: 44px; aspect-ratio: 1;
  border: 2px dashed #d1d5db; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: #f9fafb;
}
.trio-slot.filled { border-style: solid; background: #fff; }

/* 每日合体 */
.merge-next { font-size: 15px; font-weight: 600; margin: 6px 0 2px; }
.merge-next .m-emoji { font-size: 20px; }
.merge-score { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.merge-cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 6px; }
.merge-cols button {
  padding: 8px 0; border-radius: 8px; border: 1px solid #d1d5db;
  background: #eef1f5; cursor: pointer; font-size: 15px; color: #374151;
}
.merge-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.merge-cell {
  aspect-ratio: 1; border-radius: 10px; background: #f3f4f6;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: none; cursor: pointer; padding: 0; line-height: 1.2;
}
.merge-cell .m-emoji { font-size: 24px; }
.merge-cell .m-name { font-size: 10px; color: #6b7280; }

/* 贪吃蛇：菜园小青虫 */
.snake-score { font-size: 24px; font-weight: 700; margin-bottom: 2px; }
.snake-sub { color: #6b7280; font-size: 14px; margin: 0 0 10px; }
.snake-board-wrap { position: relative; }
.snake-idle-hint {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 12px; font-size: 18px; font-weight: 700; color: #15803d;
  background: rgba(240, 253, 244, .78); border-radius: 10px; pointer-events: none;
}
.snake-board {
  display: grid; grid-template-columns: repeat(15, 1fr); gap: 2px;
  width: 100%; max-width: 480px; margin: 0 auto;
  background: #f0fdf4; border: 2px solid #bbf7d0; border-radius: 10px; padding: 4px;
  touch-action: none;
}
.snake-cell {
  aspect-ratio: 1; border-radius: 3px; background: #dcfce7;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
}
.snake-head { background: #15803d; }
.snake-body { background: #4ade80; }
.snake-food { background: #fef3c7; }
.snake-pad {
  display: grid; grid-template-columns: repeat(3, 76px); grid-template-rows: repeat(2, 68px);
  gap: 10px; justify-content: center; margin: 14px 0 4px;
}
.snake-pad button {
  font-size: 28px; border-radius: 12px; border: 1px solid #d1d5db;
  background: #f9fafb; cursor: pointer; padding: 0;
}
.snake-pad button:active { background: #dcfce7; transform: scale(.94); }
.snake-actions { display: flex; gap: 8px; margin-top: 12px; }
.snake-actions .btn { flex: 1; }

/* 难度选择：三个按钮，选中态绿色实底；玩到一半时灰掉、点不动。 */
.snake-levels { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; }
.snake-levels-label { color: #6b7280; font-size: 14px; flex-shrink: 0; }
.snake-level {
  flex: 1; padding: 10px 0; font-size: 16px; border-radius: 10px;
  border: 1px solid #bbf7d0; background: #f0fdf4; color: #166534; cursor: pointer;
}
.snake-level.selected { background: #16a34a; border-color: #16a34a; color: #fff; font-weight: 700; }
.snake-level:disabled { opacity: .45; cursor: default; }

/* 手机窄屏：棋盘尽量占满宽度（卡片留边收窄，棋盘伸进卡片内边距）。 */
@media (max-width: 520px) {
  .wrap-snake { padding-left: 8px; padding-right: 8px; }
  .snake-card { padding: 12px 10px; }
  .snake-board { width: calc(100% + 16px); margin-left: -8px; margin-right: -8px; padding: 2px; }
}

/* 横屏全屏：棋盘在左、分数难度方向盘在右。真全屏靠 Fullscreen API； */
/* 不支持的浏览器（iPhone / 微信）只切布局，照样能玩。 */
/* 关键：并排布局只在屏幕真正横过来时才上身。竖屏 390px 宽度放不下 */
/* 棋盘 + 右栏：棋盘 min(76dvh, 52vw, 520px) 在竖屏是 203px，右栏只剩 */
/* 约 137px，而方向盘最少要 152px、按钮缩不到内容宽以下，于是方向盘 */
/* 和按钮叠到棋盘上、按钮挤成竖排单字条（2026-12-01 chen 竖着拿手机 */
/* 点横屏的截图）。JS 也配合：竖屏时只留提示、等旋转，不切布局。 */
.snake-main { display: block; }
@media (orientation: landscape) {
  .snake-card.snake-landscape > .snake-howto { display: none; }
  .snake-card.snake-landscape .snake-main {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    grid-template-areas: "stage top" "stage bottom";
    gap: 4px 14px;
    align-items: start;
    min-width: 0;
  }
  .snake-card.snake-landscape .snake-stage { grid-area: stage; min-width: 0; }
  .snake-card.snake-landscape .snake-side-top { grid-area: top; min-width: 0; }
  .snake-card.snake-landscape .snake-side-bottom { grid-area: bottom; align-self: end; min-width: 0; }
  /* 棋盘上限 440px：桌面宽屏卡片只有 720px 宽，棋盘 440 + 间距 14 后右栏 */
  /* 还剩约 198px，方向盘（最少 140px）和换行后的按钮都放得下；手机横屏 */
  /* 844×390 时棋盘按高度算只有 296px，右栏约 466px，更宽松。 */
  .snake-card.snake-landscape .snake-board {
    width: min(76vh, 52vw, 440px);
    width: min(76dvh, 52vw, 440px);
    margin: 0;
  }
  .snake-card.snake-landscape .snake-pad {
    grid-template-columns: repeat(3, minmax(40px, 60px));
    grid-template-rows: repeat(2, 56px);
    margin: 8px 0 4px;
  }
  /* 右栏窄时按钮换行成两排，不挤成竖排单字条。 */
  .snake-card.snake-landscape .snake-actions { flex-wrap: wrap; }
  .snake-card.snake-landscape .snake-actions .btn { flex: 1 1 40%; }
  .snake-card.snake-landscape .snake-levels { flex-wrap: wrap; }
  .snake-card.snake-landscape .snake-level { flex: 1 1 40%; min-width: 0; white-space: nowrap; }
}
.snake-card:fullscreen { background: #fff; overflow: auto; }
.snake-card:-webkit-full-screen { background: #fff; overflow: auto; }

/* 过关 / 没过关的仪式感弹窗：三款游戏共用 */
.game-end {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(15, 23, 42, .6);
}
.game-end[hidden] { display: none; }
.confetti-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti {
  position: absolute; top: -16px; width: 9px; height: 14px; border-radius: 2px;
  animation-name: confetti-fall; animation-timing-function: linear; animation-fill-mode: forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(105vh) rotate(720deg); }
}
.game-end-card {
  position: relative; z-index: 1; width: 100%; max-width: 360px;
  background: #fff; border-radius: 16px; padding: 26px 20px 20px;
  text-align: center; box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
}
.game-end-win { border-top: 6px solid #f59e0b; }
.game-end-lose { border-top: 6px solid #60a5fa; }
.game-end-title { font-size: 28px; line-height: 1.25; margin: 0 0 10px; }
.game-end-result { font-size: 16px; margin: 0 0 8px; }
.game-end-line { color: #666; margin: 0 0 14px; }
.game-end-share { text-align: left; }
.game-end-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.game-end-actions .btn { width: 100%; }
.game-end-close { margin-top: 10px; background: none; border: none; color: #999; font-size: 14px; cursor: pointer; }
.game-end-x {
  position: absolute; top: 6px; right: 8px;
  background: none; border: none; color: #9ca3af;
  font-size: 28px; line-height: 1; cursor: pointer; padding: 6px 10px;
}
.game-end-x:hover { color: #374151; }
