#forest {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
body { isolation: isolate; }
header { gap: 12px; flex-wrap: wrap; background: #101923a6; }
header nav { display: flex; flex-wrap: wrap; gap: 6px; }
header button { padding: 8px 12px; min-height: 44px; }
button[aria-pressed="true"] { color: #ffe3af; border-color: #cdae75; background: #403d33; }
button[aria-pressed]::before { content: '○'; margin-right: 5px; }
button[aria-pressed="true"]::before { content: '●'; }
.home { position: relative; }
.home > div:first-child, .lobby, .history {
  padding: clamp(16px, 3vw, 36px);
  border: 1px solid #b19e744d;
  border-radius: 16px;
  background: linear-gradient(135deg, #151e24f2, #172326ee);
  box-shadow: 0 16px 42px #060d1355;
}
.table { position: relative; overflow: hidden; }
.table .middle { min-height: 170px; }
.middle > div:nth-child(2) { overflow-wrap: anywhere; }
.table[data-phase="danger"] { border-color: #c793b5; background: radial-gradient(ellipse, #483647, #21232f); }
.table[data-phase="end"] .middle strong { color: #f6d99b; }
.table .status { color: #efdcaf; }
.hand button { touch-action: manipulation; transition: transform .18s; }
@media (hover:hover) {
  .hand button:hover { transform: translateY(-5px); }
}
@media (prefers-reduced-motion:no-preference) {
  .table[data-cue="steal"]::after {
    content: '✧'; position: absolute; top: 24%; left: 49%; z-index: 2;
    display: grid; place-items: center; width: 32px; height: 46px;
    border: 3px double #dec299; border-radius: 4px; color: #e6ca9c;
    background: #293b3d; pointer-events: none; opacity: 0;
    animation: transfer .7s ease-in-out;
  }
  .table[data-direction="outgoing"]::after { animation-direction: reverse; }
  @keyframes transfer {
    0% { opacity: 0; transform: translateY(-30px) rotate(-12deg); }
    20%, 80% { opacity: 1; }
    100% { opacity: 0; transform: translateY(132px) rotate(7deg); }
  }
  .table[data-cue="guard"] { animation: protect .65s ease-out; }
  @keyframes protect { from { box-shadow: inset 0 0 80px #accfda; } }
  .table[data-cue="deal"] .hand { animation: deal .45s ease-out; }
  @keyframes deal { from { opacity: 0; transform: translateY(14px); } }
}
@media (max-width:690px) {
  main { padding-inline: 10px; }
  .home > div:first-child { width:100%; }
  .middle .pile { width: 50px; height: 68px; }
  .hand { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding: 8px; }
  .hand .card { flex: 0 0 120px; }
}
@media (prefers-reduced-motion:reduce) {
  .hand button { transition: none; }
}

#score { max-width: 520px; padding: 12px 18px; margin: auto; background: #192426; }
#score iframe { width: 100%; height: 120px; border: 0; }
#score a { color: #e2cdac; }
