/* An original paper-and-tide tabletop. No game assets or external fonts. */
.card-picker { width: min(1240px, calc(100% - 32px)); height: min(920px, calc(100dvh - 32px)); padding: 24px 30px; background: #f8f6ef; }
.card-picker .dialog-heading { margin-bottom: 12px; }
.card-picker .dialog-heading h2 { font-size: clamp(23px, 3vw, 30px); }
.deck-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.deck-toolbar .catalog-intro { margin: 0; max-width: 440px; color: #66776d; }
.deck-search { display: flex; align-items: center; flex: 0 1 300px; min-width: 160px; border-bottom: 1px solid #b7c5b8; }
.deck-search > span { font-size: 26px; color: #678276; }
.deck-search input { width: 100%; min-width: 0; height: 44px; padding: 8px; border: 0; background: transparent; color: var(--ink); font: inherit; }
.deck-tabletop { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 18px 28px 14px; overflow: auto; overscroll-behavior: contain; border: 1px solid #768e80; border-radius: 17px; color: #eef0df; background: radial-gradient(ellipse at 33% 30%, #64857990, transparent 58%), repeating-linear-gradient(112deg, #ffffff02 0 1px, transparent 1px 5px), #365b53; box-shadow: inset 0 1px 16px #132f2a25; }
.deck-stage { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: clamp(30px, 5vw, 74px); padding: 12px 0 24px; min-height: 270px; }
.deck-focus-card { --focus-height: clamp(230px, 34dvh, 312px); width: calc(var(--focus-height) * .73); height: var(--focus-height); flex-shrink: 0; position: relative; display: flex; flex-direction: column; border: 1px solid #e7dabb; border-radius: 12px; color: #354d42; background: radial-gradient(ellipse at 50% 40%, #fffef5, #ecead9); box-shadow: 0 18px 24px #132e3140, 3px 3px 0 #d3cdbb; transform: rotate(-3deg); }
.deck-focus-card::before { content: ''; position: absolute; inset: 7px; border: 1px solid #c9cbb2; border-radius: 6px; pointer-events: none; }
.deck-card-corner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 18px 0; font-size: 9px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: #5e7463; }
.deck-card-category { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-ripples { position: relative; display: inline-block; flex-shrink: 0; width: 24px; height: 17px; border: 1px solid currentColor; border-radius: 50%; transform: rotate(-18deg); opacity: .8; }
.card-ripples::before, .card-ripples::after { content: ''; position: absolute; border: 1px solid currentColor; border-radius: 50%; }
.card-ripples::before { inset: 3px -4px -4px 3px; }
.card-ripples::after { inset: 7px -8px -8px 6px; }
.deck-focus-visual { position: relative; flex: 1; min-height: 0; margin: 0 7px; }
.deck-focus-visual .catalog-fallback img { width: 84%; height: 84%; }
.deck-card-caption { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 19px 18px; font-family: Georgia, 'Times New Roman', serif; font-size: 17px; }
.deck-card-caption > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-card-caption small { font: 10px/1 system-ui, sans-serif; color: #75816c; }
.deck-selection { max-width: 275px; min-width: 0; }
.deck-kicker { margin: 0; font-size: 9px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; color: #c4cdb6; }
.deck-selection h3 { margin: 12px 0 16px; font: 38px/1.12 Georgia, 'Times New Roman', serif; letter-spacing: -.03em; overflow-wrap: anywhere; color: #fff4d9; }
.deck-selection-hint { max-width: 250px; margin: 0 0 22px; color: #cbd8cb; font-size: 12px; line-height: 1.75; }
.deck-admin-description { margin: 0 0 18px; padding: 13px; border: 1px solid #b9cbb078; border-radius: 10px; background: #1e403c; color: #f7f6e9; text-align: left; }
.deck-admin-description h4 { margin: 0 0 4px; font: 600 13px/1.45 system-ui, sans-serif; color: #fff4d9; }
.deck-admin-description small { display: block; color: #d1dfd0; font-size: 11px; line-height: 1.45; }
.deck-admin-description p { max-height: 180px; margin: 10px 0; overflow: auto; overscroll-behavior: contain; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.65; }
.deck-admin-description button { width: 100%; min-height: 44px; padding: 8px; border: 1px solid #aec5ad; border-radius: 7px; background: #f4e7bf; color: #2e5144; font: 600 12px/1.4 system-ui, sans-serif; cursor: pointer; }
.deck-admin-description[hidden] { display: none; }
.deck-place { display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%; border: 1px solid #eee1bc; border-radius: 9px; padding: 10px 16px; background: #f4e7bf; color: #2e5144; font-weight: 650; font-size: 12px; box-shadow: 0 3px 0 #0e32244a; cursor: pointer; }
.deck-place > span:first-child { font-size: 21px; font-weight: 400; }
.deck-place:hover { background: #fff4d6; }
.deck-place:disabled { opacity: .55; cursor: wait; }
.deck-motion { display: flex; align-items: center; gap: 8px; margin: 8px auto 0; padding: 5px 8px; background: transparent; border: 0; color: #d0dccf; cursor: pointer; font-size: 10px; }
.deck-motion > span:first-child { font-size: 15px; }
.card-picker .deck-tabletop :focus-visible { outline-color: #ffe6a3; }
.deck-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 144px; gap: 22px; align-items: end; }
.deck-hand-area { min-width: 0; }
.deck-hand-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 0 8px; }
.deck-hand-heading h3 { margin: 4px 0 0; color: #f3efd9; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.deck-pagination { display: flex; align-items: center; gap: 10px; font-size: 11px; color: #d5ddca; white-space: nowrap; }
.deck-pagination button { width: 44px; border-radius: 50%; border: 1px solid #abc4aa47; background: #254e493d; color: #f9efce; cursor: pointer; font-size: 20px; }
.deck-pagination button:hover:not(:disabled) { background: #60867b; }
.deck-pagination button:disabled { opacity: .28; cursor: default; }
.deck-hand-scroll { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #a5b6a1 #294e48; scroll-padding-inline: 18px; }
.deck-hand { position: relative; display: flex; align-items: flex-end; justify-content: center; width: max-content; min-width: 100%; padding: 34px 17px 20px; }
.object-hand-card { position: relative; display: flex; flex-direction: column; flex: 0 0 115px; width: 115px; height: 154px; padding: 8px 7px 9px; margin-left: -15px; color: #334838; border: 2px solid #e0ddc6; border-radius: 9px; background: #f1f0e2; box-shadow: 0 7px 10px #112c2d42; transform: translateY(var(--card-drop)) rotate(var(--card-angle)); transform-origin: 50% 100%; transition: transform .18s ease, border-color .18s ease; cursor: pointer; touch-action: pan-x pan-y; }
.object-hand-card:first-child { margin-left: 0; }
.object-hand-card::before { content: ''; position: absolute; inset: 4px; border: 1px solid #bcc3aa; border-radius: 4px; pointer-events: none; }
.hand-card-corner { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px; font-size: 8px; color: var(--card-color); }
.hand-card-corner .card-ripples { width: 11px; height: 8px; margin-right: 6px; }
.hand-card-corner .card-ripples::before { inset: 1px -2px -2px 1px; }
.hand-card-corner .card-ripples::after { inset: 3px -4px -4px 3px; }
.hand-card-visual { display: block; flex: 1; min-height: 0; }
.hand-card-visual img { width: 88%; height: 88%; }
.hand-card-name { display: block; padding: 2px 3px; font-size: 9px; line-height: 1.2; text-align: center; min-height: 23px; overflow: hidden; overflow-wrap: anywhere; }
.object-hand-card.is-selected { z-index: 2; transform: translateY(-13px) rotate(0); border-color: #d5be78; background: #fff7de; box-shadow: 0 10px 14px #152a314d; }
@media (hover: hover) and (pointer: fine) {
  .object-hand-card:hover { z-index: 3; transform: translateY(-19px) rotate(0); border-color: #d5be78; }
}
.object-hand-card:focus-visible { z-index: 4; transform: translateY(-13px) rotate(0); }
.deck-keyboard-hint { margin: 0 0 2px; color: #b7c9be; font-size: 9px; text-align: center; }
.deck-switch { display: flex; align-items: center; flex-direction: column; gap: 5px; padding: 14px 9px 5px; border: 0; color: #f3eacb; background: transparent; cursor: pointer; text-align: center; }
.deck-stack { position: relative; display: block; width: 92px; height: 132px; margin: 0 10px 10px 0; isolation: isolate; }
.deck-stack::before, .deck-stack::after, .deck-back { position: absolute; inset: 0; border: 2px solid #d1c7a1; border-radius: 8px; background: #315953; box-shadow: 0 5px 9px #173b3740; }
.deck-stack::before, .deck-stack::after { content: ''; z-index: -1; }
.deck-stack::before { transform: translate(9px, 4px) rotate(8deg); background: #719085; }
.deck-stack::after { transform: translate(4px, 1px) rotate(3deg); background: #55796d; }
.deck-back { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 19px; padding: 12px; background: repeating-radial-gradient(ellipse at 50% 43%, transparent 0 11px, #d8c79b20 12px 13px, transparent 14px 23px), #315952; transition: transform .18s; }
.deck-back::before { content: ''; position: absolute; inset: 5px; border: 1px solid #ccb884b0; border-radius: 4px; }
.deck-back .card-ripples { width: 27px; height: 36px; color: #f2d7a2; }
.deck-back-caption { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 8px; line-height: 1.4; letter-spacing: .04em; color: #f6e4bf; overflow-wrap: anywhere; }
.deck-switch:hover .deck-back { transform: translateY(-5px) rotate(-3deg); }
.deck-switch-label { font-size: 12px; font-weight: 650; }
.deck-switch-hint { font-size: 9px; color: #bdcfc0; }
.deck-empty { flex: 1; min-height: 270px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px; }
.deck-empty h3 { margin: 25px 0 0; font: 25px Georgia, serif; }
.deck-empty p { color: #d0d9c8; max-width: 350px; font-size: 12px; }
.deck-empty button { margin-top: 10px; }
.deck-library { width: min(600px, calc(100% - 32px)); max-height: min(700px, calc(100dvh - 44px)); margin: auto max(22px, calc((100vw - 1180px) / 2)) 30px auto; padding: 25px; background: #f6f2e7; }
.deck-library::backdrop { background: #14382b4a; backdrop-filter: blur(3px); }
.deck-library > input { width: 100%; border: 1px solid #ccd2c1; background: #fffcf4; border-radius: 9px; padding: 12px; font: inherit; color: var(--ink); margin: 4px 0 16px; }
.category-decks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.category-deck { display: flex; gap: 15px; align-items: center; min-width: 0; padding: 12px; border: 1px solid #d9dccb; border-radius: 10px; background: #fffcf3; text-align: left; cursor: pointer; }
.category-deck:hover { border-color: #688770; background: #f0f2e4; }
.category-deck[aria-pressed=true] { border-color: #688770; background: #e5eddb; }
.category-deck-back { width: 40px; height: 54px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 3px double #ece2c5; border-radius: 5px; color: #eee0b7; background: var(--card-color); box-shadow: 2px 2px 0 #c7cbb6; }
.category-deck-back .card-ripples { width: 15px; height: 22px; margin: 0 6px 3px 0; }
.category-deck-copy { min-width: 0; }
.category-deck-copy strong { display: block; font-size: 12px; font-weight: 550; overflow-wrap: anywhere; }
.category-deck-copy small { display: block; font-size: 10px; color: #647765; margin-top: 5px; }
@media (min-width: 1000px) and (min-height: 850px) {
  .object-hand-card { width: 127px; flex-basis: 127px; height: 173px; }
  .hand-card-name { font-size: 10px; }
  .deck-tabletop { padding-top: 24px; padding-bottom: 20px; }
}
@media (max-width: 900px) {
  .card-picker { padding: 22px; }
  .deck-tabletop { padding: 16px 18px 12px; }
  .deck-bottom { grid-template-columns: minmax(0, 1fr) 115px; gap: 8px; }
  .deck-stack { width: 76px; height: 112px; }
  .deck-hand { justify-content: flex-start; }
  .deck-keyboard-hint { text-align: left; padding-left: 12px; }
}
@media (max-width: 600px) {
  .card-picker { width: calc(100% - 12px); max-width: calc(100% - 12px); height: calc(100dvh - 12px); max-height: calc(100dvh - 12px); padding: 16px 12px 12px; border-radius: 18px; }
  .card-picker .dialog-heading { margin: 0 6px 10px; }
  .card-picker .dialog-heading h2 { font-size: 23px; }
  .card-picker .eyebrow { font-size: 8px; }
  .deck-toolbar { display: block; margin: 0 6px 14px; }
  .deck-toolbar .catalog-intro { font-size: 11px; margin-bottom: 3px; }
  .deck-search input { height: 40px; font-size: 16px; }
  .deck-tabletop { padding: 18px 12px 10px; border-radius: 12px; }
  .deck-stage { gap: 17px; min-height: 260px; padding: 6px 5px 28px; }
  .deck-stage:has(.deck-admin-description:not([hidden])) { flex-wrap: wrap; }
  .deck-stage:has(.deck-admin-description:not([hidden])) .deck-selection { flex-basis: 100%; max-width: 100%; }
  .deck-focus-card { --focus-height: clamp(180px, 49vw, 255px); }
  .deck-card-corner { padding: 14px 13px 0; font-size: 7px; gap: 8px; }
  .deck-card-corner .card-ripples { width: 14px; height: 10px; margin-right: 4px; }
  .deck-card-caption { font-size: 12px; padding: 0 13px 14px; }
  .deck-card-caption small { font-size: 8px; }
  .deck-selection { flex: 1; }
  .deck-selection h3 { margin: 8px 0 10px; font-size: clamp(23px, 6vw, 31px); }
  .deck-selection .deck-kicker { font-size: 7px; letter-spacing: .09em; }
  .deck-selection-hint { font-size: 10px; line-height: 1.6; margin-bottom: 14px; }
  .deck-place { padding: 8px; gap: 5px; font-size: 10px; }
  .deck-place > span:first-child { font-size: 17px; }
  .deck-motion { font-size: 8px; gap: 4px; padding: 4px 0; margin-top: 4px; }
  .deck-bottom { grid-template-columns: minmax(0, 1fr) 90px; gap: 4px; }
  .deck-hand-heading { padding: 0 4px; flex-wrap: wrap; gap: 6px; }
  .deck-hand-heading h3 { font-size: 11px; }
  .deck-kicker { font-size: 8px; }
  .deck-pagination { gap: 8px; font-size: 10px; }
  .deck-pagination button { width: 44px; min-height: 44px; font-size: 16px; }
  .deck-hand { padding: 27px 8px 14px; }
  .object-hand-card { flex-basis: 96px; width: 96px; height: 132px; margin-left: -9px; transform: none; }
  .object-hand-card.is-selected { transform: translateY(-9px); }
  .hand-card-name { font-size: 8px; }
  .deck-keyboard-hint { font-size: 8px; padding-left: 4px; max-width: 220px; }
  .deck-stack { width: 61px; height: 88px; margin-right: 4px; }
  .deck-back { gap: 11px; padding: 8px; }
  .deck-back .card-ripples { width: 18px; height: 25px; }
  .deck-back-caption { font-size: 6px; }
  .deck-switch { padding: 8px 4px 24px; }
  .deck-switch-label { font-size: 10px; }
  .deck-switch-hint { font-size: 8px; }
  .deck-library { width: calc(100% - 20px); margin: auto 10px 14px; padding: 19px; }
  .deck-library > input { font-size: 16px; }
  .category-decks { gap: 8px; }
  .category-deck { padding: 9px; gap: 10px; }
  .category-deck-copy strong { font-size: 11px; }
  .category-deck-back { width: 31px; height: 46px; }
}
@media (max-width: 370px) {
  .deck-stage { flex-direction: column; align-items: center; gap: 18px; }
  .deck-selection { width: 100%; max-width: 230px; text-align: center; }
  .deck-selection h3 { font-size: 26px; margin-bottom: 12px; }
  .deck-selection-hint { display: none; }
  .deck-place { font-size: 12px; }
  .deck-motion { font-size: 10px; }
  .deck-focus-card { --focus-height: 200px; }
}
@media (max-height: 600px) and (min-width: 601px) {
  .card-picker { padding: 16px; }
  .deck-toolbar { margin-bottom: 10px; }
  .deck-stage { min-height: 236px; }
  .deck-focus-card { --focus-height: 200px; }
  .deck-selection h3 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .object-hand-card, .deck-back { transition: none; }
  .object-hand-card, .object-hand-card.is-selected, .object-hand-card:hover, .object-hand-card:focus-visible { transform: none; }
}
