/* ======================================================================
   Game menu (hub) + "Noch mal so gut!"
   ====================================================================== */

/* ---------- Game menu ---------- */
.hub-inner { width: min(460px, 100%); }
.hub-title { font-size: 34px; font-weight: 900; margin: 0 0 4px; letter-spacing: -.5px; }
.hub-games { display: grid; gap: 14px; margin: 22px 0 16px; text-align: left; }
.game-card {
  appearance: none; display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: 20px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  cursor: pointer; transition: transform 90ms, background 120ms, border-color 120ms;
  font: inherit;
}
.game-card:active { transform: scale(.98); background: var(--panel-2); }
.game-card:hover { border-color: rgba(255,255,255,.25); }
.gc-art {
  flex: none; width: 100px; height: 74px; border-radius: 14px;
  display: grid; place-items: center; overflow: hidden;
}
.gc-qwixx { background: #1d2532; display: flex; align-items: center; justify-content: center; gap: 2px; }
.gc-qwixx .lg { width: 17px; height: 23px; font-size: 13px; border-radius: 5px; font-style: normal; box-shadow: 0 2px 5px rgba(0,0,0,.35); }
.gc-nm { background: #c7cfce; padding: 6px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.gc-nm i { display: block; width: 100%; aspect-ratio: 1; border-radius: 3px; background: var(--tile); position: relative; }
.gc-nm i.x::after {
  content: ""; position: absolute; inset: 12%;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b2130' stroke-width='3.6' stroke-linecap='round'%3E%3Cpath d='M5 5l14 14M19 5L5 19'/%3E%3C/svg%3E");
}
.gc-text { flex: 1; min-width: 0; }
.gc-text b { display: block; font-size: 19px; margin-bottom: 2px; }
.gc-text span { font-size: 13px; color: var(--muted); line-height: 1.35; }
.gc-go { font-size: 30px; color: var(--muted); padding-right: 4px; }
.hub-row { grid-template-columns: 1fr !important; }
.home-back { position: absolute; top: calc(var(--safe-top) + 10px); left: calc(var(--safe-left) + 12px); z-index: 2; }

/* ---------- Colors (from the original block) ---------- */
.nm-pink   { --tile: #ff2f72; --tile-l: #ff6e9d; }
.nm-orange { --tile: #ff8726; --tile-l: #ffab68; }
.nm-yellow { --tile: #ffc734; --tile-l: #ffe39a; }
.nm-green  { --tile: #88c946; --tile-l: #acd97e; }
.nm-blue   { --tile: #52d3f7; --tile-l: #86e0f9; }
.cname { color: var(--tile); font-weight: 800; }
.cdot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--tile); vertical-align: -1px; }
.tic svg { width: 17px; height: 17px; vertical-align: -3px; }

/* ---------- Logo ---------- */
.nm-logo { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 8px; }
.nm-logo span {
  font-weight: 900; font-size: 46px; line-height: 1; letter-spacing: 1px;
  background: linear-gradient(90deg, #ff2f72, #ff8726 25%, #ffc734 45%, #88c946 65%, #52d3f7 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.35));
}
.nm-logo span:first-child { transform: rotate(-3deg); }
.nm-logo span:last-child { transform: rotate(2deg); font-size: 52px; }

/* ---------- Game screen: base ---------- */
#screen-nm-game .nm-left { display: contents; }
#screen-nm-game.active { display: grid; }
.nm-sheet-area {
  grid-area: sheet; min-height: 0; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  container-type: size;
}
#screen-nm-game .status { grid-area: status; }
.nm-chooser { grid-area: chooser; display: grid; gap: 6px; }
.nm-inv { grid-area: inv; }

/* ---------- Scoresheet ---------- */
.nm-sheet {
  --c: 30px;
  background: #c7cfce;
  border-radius: 14px;
  padding: 8px 8px 6px;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
  color: #1d1f22;
  max-width: 100%;
}
.nm-grid {
  display: grid;
  grid-template-columns: calc(var(--c) * .72) calc(var(--c) * .9) repeat(15, var(--c)) calc(var(--c) * .62) 2px calc(var(--c) * 1.3);
  grid-template-rows: calc(var(--c) * .55) repeat(7, var(--c)) repeat(3, calc(var(--c) * .62));
  gap: 2px;
}
.nm-head {
  display: grid; place-items: center;
  font-weight: 900; font-size: calc(var(--c) * .42);
  background: #fff; border-radius: 5px;
}
.nm-head.start { color: #e5242b; }
.nm-rowpts, .nm-rowletter {
  display: grid; place-items: center; background: #fff; border-radius: 5px;
  font-weight: 900; font-size: calc(var(--c) * .45);
}
.nm-rowletter { font-size: calc(var(--c) * .4); }
.nm-rowbonus { display: grid; place-items: center; background: #fff; border-radius: 5px; position: relative; }
.nm-rowbonus svg { width: 74%; height: 74%; }
.nm-rowpts.got, .nm-rowbonus.got { box-shadow: 0 0 0 2px #1d1f22 inset; }
.nm-rowbonus.got::after, .nm-colpts.got::after, .nm-colorbonus .got::after {
  content: ""; position: absolute; inset: 1px; border-radius: 50%;
  border: 2px solid #1d1f22;
}
.nm-rowbonus.gone, .nm-colpts.gone, .nm-colorbonus .gone { opacity: .35; }
.nm-rowbonus.gone::before, .nm-colpts.gone::before, .nm-colorbonus .gone::before {
  content: ""; position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; background: #1d1f22; transform: rotate(-25deg);
}

.nm-cell {
  position: relative; border: 0; padding: 0; margin: 0;
  background: var(--tile); border-radius: 22%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 1px 0 rgba(0,0,0,.12);
  cursor: default; font: inherit;
  transition: transform 90ms, box-shadow 140ms;
}
.nm-cell .dot { position: absolute; inset: 15%; border-radius: 50%; background: var(--tile-l); pointer-events: none; }
.nm-cell .ic { position: absolute; inset: 14%; pointer-events: none; display: grid; place-items: center; }
.nm-cell .ic svg { width: 100%; height: 100%; }
.nm-cell .ic.gold { inset: 20%; filter: drop-shadow(0 1px 0 rgba(0,0,0,.25)); }
/* Block borders: dark line wherever another block starts */
.nm-cell::before {
  content: ""; position: absolute; inset: -2px; pointer-events: none;
  border: 0 solid #22252b; border-radius: 6px;
}
.nm-cell.bt::before { border-top-width: 2.5px; }
.nm-cell.bb::before { border-bottom-width: 2.5px; }
.nm-cell.bl::before { border-left-width: 2.5px; }
.nm-cell.br::before { border-right-width: 2.5px; }
.nm-cell.start { box-shadow: inset 0 0 0 2px rgba(255,255,255,.95), 0 1px 0 rgba(0,0,0,.12); }
.nm-cell.marked::after, .nm-cell.sel::after {
  content: ""; position: absolute; inset: 10%; z-index: 2;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b2130' stroke-width='3.6' stroke-linecap='round'%3E%3Cpath d='M5 5l14 14M19 5L5 19'/%3E%3C/svg%3E");
}
.nm-cell.marked .dot { opacity: .55; }
.nm-cell.cand {
  cursor: pointer; z-index: 3;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1d1f22, 0 3px 8px rgba(0,0,0,.35);
  animation: nm-cand 1.3s ease-in-out infinite;
}
@keyframes nm-cand {
  0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1d1f22, 0 3px 8px rgba(0,0,0,.35); }
  50% { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(29,31,34,.35), 0 3px 8px rgba(0,0,0,.35); }
}
.nm-cell.sel { z-index: 4; cursor: pointer; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent), 0 3px 10px rgba(0,0,0,.4); }
.nm-cell.sel::after { opacity: .85; animation: mark-pop 160ms cubic-bezier(.3,1.6,.5,1) both; }
.nm-cell.pop::after { animation: mark-pop 220ms cubic-bezier(.3,1.6,.5,1) both; }
.nm-cell.nope { animation: nope 260ms ease-in-out; }
.nm-cell.cand:active { transform: scale(.92); }

.nm-colpts {
  display: grid; place-items: center; position: relative;
  background: #fff; border-radius: 5px; font-weight: 900; font-size: calc(var(--c) * .42);
}
.nm-colpts.sp { background: linear-gradient(#ffe6c4, #f6c98c); }
.nm-colheart {
  display: grid; place-items: center; position: relative;
  background: no-repeat center/78% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.4C.8 7.8 3.4 4 7 4c2 0 3.6 1.1 5 3 1.4-1.9 3-3 5-3 3.6 0 6.2 3.8 4.6 7.6C19.5 16.4 12 21 12 21z' fill='%23ffb3bd'/%3E%3C/svg%3E"), #fff;
  border-radius: 5px; font-weight: 900; font-size: calc(var(--c) * .36); color: #fff;
}
.nm-colheart.got {
  background: no-repeat center/82% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.4C.8 7.8 3.4 4 7 4c2 0 3.6 1.1 5 3 1.4-1.9 3-3 5-3 3.6 0 6.2 3.8 4.6 7.6C19.5 16.4 12 21 12 21z' fill='%23ef2b3b'/%3E%3C/svg%3E"), #fff;
}
.nm-colorbonus {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  background: var(--tile); border-radius: 5px; padding: 2px;
}
.nm-colorbonus span {
  display: grid; place-items: center; position: relative;
  background: var(--tile-l); border-radius: 3px;
  font-weight: 900; font-size: calc(var(--c) * .4); color: rgba(0,0,0,.55);
}

.nm-sheet .peek-banner { display: none; }
.nm-sheet.peek .peek-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; margin: 0 0 6px; padding: 6px 10px; border: 0; border-radius: 8px;
  background: #1d1f22; color: #fff; cursor: pointer;
  font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- Dice in the bowl ---------- */
.die.nm-num { background: #262a31; --pip: #fff; }
.die.nm-num .q {
  display: none; position: absolute; inset: 0; place-items: center;
  color: #fff; font-weight: 900; font-size: 12cqw;
}
.die.nm-num[data-face="6"] .pip { opacity: 0 !important; }
.die.nm-num[data-face="6"] .q { display: grid; }
.die.nm-col { background: #fdfdfd; }
.die.nm-col .xmark { position: absolute; inset: 20%; }
.die.nm-col .xmark::before, .die.nm-col .xmark::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 118%; height: 24%; border-radius: 99px;
  background: var(--xc, #ccc);
  transform: translate(-50%, -50%) rotate(45deg);
}
.die.nm-col .xmark::after { transform: translate(-50%, -50%) rotate(-45deg); }
.die.nm-col[data-face="1"] { --xc: #88c946; }
.die.nm-col[data-face="2"] { --xc: #ffc734; }
.die.nm-col[data-face="3"] { --xc: #52d3f7; }
.die.nm-col[data-face="4"] { --xc: #ff2f72; }
.die.nm-col[data-face="5"] { --xc: #ff8726; }
.die.nm-col[data-face="6"] { --xc: #1d1f22; }
.die.nm-sp { background: #fffaf2; }
.die.nm-sp .sp-ic { display: none; position: absolute; inset: 14%; }
.die.nm-sp .sp-ic svg { width: 100%; height: 100%; }
.die.nm-sp[data-face="1"] .f1, .die.nm-sp[data-face="6"] .f1,
.die.nm-sp[data-face="2"] .f2, .die.nm-sp[data-face="3"] .f3,
.die.nm-sp[data-face="4"] .f4, .die.nm-sp[data-face="5"] .f5 { display: block; }
.die.pickable { cursor: pointer; }
.die.taken { opacity: .28; }
.die.nm-col.used, .die.nm-num.used, .die.nm-sp.used { z-index: 4; }

/* ---------- Joker choice ---------- */
.nm-choose { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.nm-cpick, .nm-npick {
  appearance: none; width: 32px; height: 32px; border-radius: 9px; cursor: pointer;
  border: 2px solid rgba(255,255,255,.15); font: inherit;
}
.nm-cpick { background: var(--tile); }
.nm-npick { background: #262a31; color: #fff; font-weight: 900; font-size: 16px; }
.nm-cpick.on, .nm-npick.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }

/* ---------- Inventory: hearts, jokers, special dice ---------- */
.nm-inv { display: grid; gap: 4px; padding-top: 6px; }
.inv-row { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.inv-lab { display: inline-grid; place-items: center; min-width: 22px; font-size: 11px; font-weight: 800; color: var(--muted); }
.inv-lab svg { width: 16px; height: 16px; }
.inv-heart {
  font-style: normal; display: inline-grid; place-items: center;
  width: 20px; height: 18px; font-size: 10px; font-weight: 900; color: #ffb3bd;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.4C.8 7.8 3.4 4 7 4c2 0 3.6 1.1 5 3 1.4-1.9 3-3 5-3 3.6 0 6.2 3.8 4.6 7.6C19.5 16.4 12 21 12 21z' fill='none' stroke='%23ff8a95' stroke-width='2'/%3E%3C/svg%3E");
}
.inv-heart.on {
  color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.4C.8 7.8 3.4 4 7 4c2 0 3.6 1.1 5 3 1.4-1.9 3-3 5-3 3.6 0 6.2 3.8 4.6 7.6C19.5 16.4 12 21 12 21z' fill='%23ef2b3b'/%3E%3C/svg%3E");
}
.inv-joker {
  font-style: normal; display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--text); font-size: 11px; font-weight: 900; position: relative;
}
.inv-joker.used { opacity: .3; }
.inv-joker.used::after { content: ""; position: absolute; left: -2px; right: -2px; top: 50%; height: 1.5px; background: var(--text); transform: rotate(-35deg); }
.inv-sp { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; opacity: .28; position: relative; }
.inv-sp svg { width: 15px; height: 15px; }
.inv-sp.on { opacity: 1; box-shadow: 0 0 0 1.5px var(--text); }
.inv-sp.used { opacity: .35; }
.inv-sp.used::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; color: #ff8a8a; font-size: 14px; font-weight: 900; }

.nm-cdots { display: inline-flex; gap: 2px; }
.nm-cdots .cdot { width: 8px; height: 8px; border-radius: 2px; }
.table-scroll { overflow-x: auto; }
.nm-end th, .nm-end td { padding: 7px 3px; font-size: 13px; }

/* ---------- Landscape (phone held sideways, tablet, PC) ---------- */
@media (min-aspect-ratio: 4001/3000) {
  #screen-nm-game.active {
    --left-w: clamp(160px, min(25vw, calc(100dvh - 200px - var(--safe-bottom))), 360px);
    grid-template-columns: var(--left-w) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
    grid-template-areas:
      "dice    top"
      "dice    sheet"
      "status  sheet"
      "chooser sheet"
      "inv     sheet"
      "act     sheet";
    column-gap: 14px;
    padding: max(6px, var(--safe-top)) max(12px, var(--safe-right)) max(8px, var(--safe-bottom)) max(12px, var(--safe-left));
  }
  #screen-nm-game .status { text-align: left; justify-content: flex-start; font-size: 13px; padding-top: 8px; }
  .nm-sheet { --c: max(16px, min(calc((100cqw - 56px) / 18.6), calc((100cqh - 46px) / 9.05))); }
}
@media (min-aspect-ratio: 4001/3000) and (min-width: 1000px) and (min-height: 620px) {
  #screen-nm-game.active {
    --left-w: clamp(260px, 24vw, 380px);
    grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr);
    grid-template-areas:
      "dice    top"
      "dice    sheet"
      "status  sheet"
      "chooser sheet"
      "act     sheet"
      "inv     sheet"
      ".       sheet";
    column-gap: 32px;
    padding: 22px 32px;
  }
  #screen-nm-game .status { font-size: 15px; }
  .nm-inv { padding-top: 14px; }
  .inv-heart { width: 24px; height: 22px; font-size: 11px; }
  .inv-joker { width: 22px; height: 22px; font-size: 13px; }
  .inv-sp { width: 24px; height: 24px; }
  .inv-sp svg { width: 18px; height: 18px; }
}

/* ---------- Portrait (phone upright) ---------- */
@media (max-aspect-ratio: 4/3) {
  #screen-nm-game.active {
    --bowl: clamp(120px, min(42vw, 25dvh), 280px);
    grid-template-columns: var(--bowl) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "top   top"
      "dice  status"
      "dice  chooser"
      "dice  inv"
      "sheet sheet"
      "act   act";
    column-gap: 12px;
    padding: var(--safe-top) max(8px, var(--safe-right)) 0 max(8px, var(--safe-left));
  }
  #screen-nm-game .status { align-self: end; text-align: left; justify-content: flex-start; font-size: 14px; }
  .nm-sheet-area { padding: 8px 0 2px; }
  .nm-sheet { padding: 6px 5px 5px; --c: max(15px, min(calc((100cqw - 44px) / 16.1), calc((100cqh - 40px) / 9.05))); }
  /* On narrow screens: only icon column on the left, no row letters/color boxes on the right */
  .nm-grid { grid-template-columns: 0 calc(var(--c) * .9) repeat(15, var(--c)) 0 0 0; column-gap: 1.5px; }
  .nm-rowpts, .nm-rowletter, .nm-colorbonus { display: none; }
}

/* ---------- Fine-tuning: status as flowing text, selected dice clearly visible, compact left column ---------- */
#screen-nm-game .status { display: block; line-height: 1.35; min-height: 0; }
#screen-nm-game .status .who { display: inline-block; }
#nm-dice .die.used {
  box-shadow: 0 0 0 0.8cqw #fff, 0 0 0 2.2cqw var(--accent), 0 1.4cqw 3cqw rgba(0,0,0,.5);
  filter: none;
}
@media (min-aspect-ratio: 4001/3000) and (max-height: 520px) {
  #screen-nm-game .status { font-size: 12.5px; padding-top: 6px; max-height: 3.9em; overflow: hidden; }
  .nm-inv { gap: 2px; padding-top: 4px; }
  .inv-row { gap: 2px; flex-wrap: nowrap; }
  .inv-heart { width: 16px; height: 15px; font-size: 8.5px; }
  .inv-joker { width: 15px; height: 15px; font-size: 9px; border-width: 1.2px; }
  .inv-sp { width: 16px; height: 16px; }
  .inv-sp svg { width: 12px; height: 12px; }
  .inv-lab { min-width: 18px; }
  .inv-lab svg { width: 13px; height: 13px; }
  #screen-nm-game .actionbar .main { font-size: 15px; }
  .nm-cpick, .nm-npick { width: 28px; height: 28px; }
}

/* Portrait: tip to turn the phone (15 columns are wide) */
@media (max-aspect-ratio: 4/3) and (max-width: 600px) {
  .nm-sheet-area { flex-direction: column; gap: 10px; }
  .nm-sheet-area::after {
    content: "📱↻  Tipp: Handy quer halten – dann wird das Blatt größer.";
    font-size: 12.5px; color: var(--muted); text-align: center;
  }
}
#nm-btn-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Points: labels on the block + "Punkte" button + table */
.nm-ptlab { display: flex; align-items: center; justify-content: flex-end; padding-right: 3px; font-size: 9px; font-weight: 800; color: #3b4452; white-space: nowrap; }
.nm-ptlab svg { width: 10px; height: 10px; margin-left: 1px; }
.pts-btn {
  appearance: none; flex: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 800; color: var(--text);
  height: 42px; padding: 0 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
}
.pts-btn:active { transform: scale(.95); }
@media (min-aspect-ratio: 4001/3000) { .topbar .pts-btn { height: 36px; } }
.pt-list { display: grid; gap: 6px; margin: 8px 0 10px; }
.pt-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  font-size: 13px; line-height: 1.35; color: var(--muted);
}
.pt-row b { color: var(--text); font-size: 14px; }
.pt-ico { display: grid; place-items: center; height: 36px; border-radius: 9px; background: #c7cfce; color: #1b2130; font-weight: 900; font-size: 15px; }
.pt-ico.pt-cols { grid-template-rows: 1fr 1fr; line-height: 1; padding: 2px 0; }
.pt-ico.pt-cols small { font-size: 11px; color: #4b5563; }
.pt-ico.pt-color { display: flex; justify-content: center; align-items: center; gap: 3px; }
.pt-ico.pt-color i { width: 13px; height: 13px; border-radius: 3px; background: var(--tile); }
.pt-val { font-size: 18px; font-weight: 900; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pt-row.neg .pt-val { color: #ff8a8a; }
