.fc { --cw: 72px; --ch: 101px; --ov: 26px; --gap: 8px; --fs: 18px; --topgap: 14px; max-width: 920px; margin: 0 auto; padding: 8px 6px 14px; color: #dfe9ff; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.fc [hidden] { display: none !important; }
.fc-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
/* ---- bar ---- */
.fc-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px 10px; flex-wrap: wrap; margin: 0 0 10px; }
.fc-info { display: flex; align-items: center; gap: 14px; font-size: 13px; color: #8aa3c4; font-variant-numeric: tabular-nums; }
.fc-stat b { color: #fff; margin-left: 3px; }
.fc-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0 11px; border-radius: 999px; border: 1px solid #1c2b4a; background: #0b1328; color: #8aa3c4; font: inherit; font-size: 13px; cursor: pointer; touch-action: manipulation; transition: border-color .15s; }
.fc-chip b { color: #ffd166; font-weight: 800; }
.fc-tools { display: flex; align-items: center; gap: 6px; }
.fc-btn { min-height: 40px; background: #0b1328; color: #dfe9ff; border: 1px solid #1c2b4a; border-radius: 9px; padding: 0 14px; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; touch-action: manipulation; transition: border-color .15s, background-color .15s, opacity .15s, transform .1s; }
.fc-btn-icon { width: 40px; padding: 0; display: inline-grid; place-items: center; }
.fc-btn-icon svg { width: 18px; height: 18px; }
@media (hover: hover) { .fc-btn:hover:not(:disabled), .fc-chip:hover { border-color: #55d6ff; } .fc-btn-primary:hover:not(:disabled) { background: #ffe08a; border-color: #ffe08a; } }
.fc-btn:active:not(:disabled) { transform: scale(0.96); }
.fc-btn:disabled { opacity: 0.4; cursor: default; }
.fc-btn-primary { background: #ffd166; color: #1a1200; border-color: #ffd166; }
.fc-btn:focus-visible, .fc-chip:focus-visible { outline: 2px solid #55d6ff; outline-offset: 2px; }
.fc-btn.fc-busy { position: relative; color: transparent; }
.fc-btn.fc-busy::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid #55d6ff; border-right-color: transparent; animation: fc-spin .7s linear infinite; }
/* ---- table ---- */
.fc-table { position: relative; background: radial-gradient(ellipse at 50% 25%, #1a4a63, #0c2a40 72%); border: 1px solid #2d5f7a; border-radius: 12px; padding: 12px; min-height: calc(var(--ch) * 2 + var(--topgap) + var(--ov) * 11 + 26px); touch-action: manipulation; outline: none; }
.fc-top { display: grid; grid-template-columns: repeat(8, var(--cw)); gap: var(--gap); justify-content: space-between; margin: 0 0 var(--topgap); }
.fc-cells, .fc-founds { display: contents; }
.fc-tableau { display: grid; grid-template-columns: repeat(8, var(--cw)); gap: var(--gap); justify-content: space-between; align-items: start; }
.fc-pile { position: relative; width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * 0.09); transition: box-shadow .12s; touch-action: none; }   /* a finger landing on a gliding card still drags, never scrolls */
.fc-cell { background: rgba(0,0,0,0.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16); }
.fc-found { background: rgba(255,255,255,0.04); box-shadow: inset 0 0 0 1px rgba(255,209,102,0.28); }
.fc-col { min-height: var(--ch); }
.fc-col:empty { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14); background: rgba(0,0,0,0.08); }
.fc-ghost { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,209,102,0.32); font-size: calc(var(--cw) * 0.36); font-weight: 800; pointer-events: none; }
.fc-pile.fc-target { box-shadow: 0 0 0 2px #55d6ff, 0 0 18px rgba(85,214,255,0.35); }
.fc-col.fc-target:not(:empty) { box-shadow: none; }
.fc-col.fc-target .fc-card:last-child { box-shadow: 0 0 0 2px #55d6ff, 0 0 16px rgba(85,214,255,0.4); }
.fc-pile:focus { outline: none; }
.fc-pile:focus-visible { outline: 2px dashed #55d6ff; outline-offset: 2px; z-index: 2; }
.fc-pile.fc-hint-to { box-shadow: 0 0 0 3px #55d6ff; animation: fc-pulse 0.9s ease-in-out 3; }
.fc-col.fc-hint-to:not(:empty) { box-shadow: none; animation: none; }
.fc-col.fc-hint-to .fc-card:last-child { box-shadow: 0 0 0 3px #55d6ff, 0 1px 2px rgba(0,0,0,0.4); animation: fc-pulse 0.9s ease-in-out 3; }
/* ---- cards ---- */
.fc-card { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * 0.09); background: linear-gradient(#ffffff, #f4f4ee); box-shadow: 0 0 0 0.5px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.38); color: #1b1d22; cursor: grab; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; }
.fc-card.red { color: #c8202f; }
.fc-four .fc-card.s0 { color: #1d7a3a; } .fc-four .fc-card.s1 { color: #1f5fc4; }
.fc-card svg { display: block; fill: currentColor; }
.fc-card .ix { position: absolute; left: calc(var(--cw) * 0.07); top: calc(var(--fs) * 0.08); display: flex; align-items: center; gap: calc(var(--fs) * 0.06); height: calc(var(--fs) * 1.08); font-size: var(--fs); font-weight: 800; line-height: 1; letter-spacing: -0.05em; white-space: nowrap; }  /* rank and suit on one line: all that shows under the next card */
.fc-card .ix svg { width: calc(var(--fs) * 0.82); height: calc(var(--fs) * 0.82); flex: none; }
.fc-card .big { position: absolute; right: calc(var(--cw) * 0.08); bottom: calc(var(--cw) * 0.08); width: calc(var(--cw) * 0.5); height: calc(var(--cw) * 0.5); opacity: 0.92; }
.fc-card .face { position: absolute; left: calc(var(--cw) * 0.1); bottom: calc(var(--cw) * 0.06); font-size: calc(var(--cw) * 0.42); font-weight: 900; line-height: 1; opacity: 0.16; letter-spacing: -0.04em; }
.fc-card.sel { box-shadow: inset 0 0 0 3px #ffd166, 0 1px 2px rgba(0,0,0,0.4); }
.fc-card.fc-hint { box-shadow: inset 0 0 0 3px #55d6ff, 0 1px 2px rgba(0,0,0,0.4); animation: fc-pulse 0.9s ease-in-out 3; }
.fc-card.fc-shake { animation: fc-shake .32s ease; }
.fc-drag { position: absolute; left: 0; top: 0; z-index: 60; pointer-events: none; }
.fc-drag .fc-card { box-shadow: 0 0 0 0.5px rgba(0,0,0,0.25), 0 12px 26px rgba(0,0,0,0.45); cursor: grabbing; }
.fc-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 65; border-radius: 12px; cursor: pointer; touch-action: manipulation; }
/* ---- toast, status, help ---- */
.fc-toast { position: absolute; left: 50%; top: 10px; z-index: 66; max-width: calc(100% - 24px); transform: translate(-50%, -6px); background: #f4f7fb; color: #0b1328; font-weight: 750; font-size: 13.5px; padding: 8px 15px; border-radius: 999px; pointer-events: none; opacity: 0; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.fc-toast.show { animation: fc-toast 2.4s ease forwards; }
.fc-toast.warn { background: #ffd166; color: #1a1200; }
.fc-status { min-height: 1.4em; margin: 8px 2px 0; font-size: 13px; color: #8aa3c4; text-align: center; }
.fc-status.warn { color: #ffd166; }
.fc-help { color: #8aa3c4; font-size: 12px; line-height: 1.55; margin: 6px 0 0; }
.fc-help kbd { background: #16213a; color: #bfe9ff; border-radius: 3px; padding: 0 5px; font-family: inherit; font-size: 11.5px; }
@media (hover: none) { .fc-keys { display: none; } }
/* ---- sheets (game number, statistics, settings, results) ---- */
.fc-scrim { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2,4,10,0.62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fc-fade .2s ease; }
.fc-sheet { position: relative; width: 100%; max-width: 400px; max-height: calc(100% - 8px); overflow: auto; overscroll-behavior: contain; background: #0d1630; border: 1px solid #22345a; border-radius: 18px; padding: 22px 20px 18px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); color: #dfe9ff; animation: fc-pop .3s cubic-bezier(.2,1.2,.4,1); }
.fc-sheet:focus { outline: none; }
.fc-sheet h3 { margin: 0 36px 4px 0; font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.01em; }
.fc-sheet p { margin: 0 0 12px; color: #8aa3c4; font-size: 14px; line-height: 1.5; }
.fc-sheet .fc-lead { color: #dfe9ff; font-size: 15px; }
.fc-x { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: #8aa3c4; font-size: 24px; line-height: 1; cursor: pointer; }
.fc-x:hover { background: rgba(255,255,255,0.06); color: #fff; }
.fc-x:focus-visible { outline: 2px solid #55d6ff; }
.fc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.fc-actions .fc-btn { flex: 1 1 0; min-width: max-content; min-height: 44px; }
.fc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 4px; }
.fc-grid div { background: #0b1328; border: 1px solid #1c2b4a; border-radius: 10px; padding: 8px 4px; text-align: center; }
.fc-grid b { display: block; font-size: 20px; color: #fff; font-variant-numeric: tabular-nums; }
.fc-grid span { display: block; font-size: 11px; line-height: 1.25; margin-top: 2px; color: #8aa3c4; }
.fc-h4 { margin: 18px 0 8px; font-size: 13px; font-weight: 800; color: #8aa3c4; text-transform: uppercase; letter-spacing: 0.06em; }
.fc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid #16213a; font-size: 14px; }
.fc-row:first-of-type { border-top: 0; }
.fc-seg { display: inline-flex; background: #0b1328; border: 1px solid #1c2b4a; border-radius: 9px; padding: 2px; flex: none; }
.fc-seg button { min-height: 34px; border: 0; background: transparent; color: #8aa3c4; font: inherit; font-size: 13px; font-weight: 700; padding: 0 11px; border-radius: 7px; cursor: pointer; touch-action: manipulation; }
.fc-seg button[aria-pressed="true"], .fc-seg button[aria-checked="true"] { background: #1c2b4a; color: #fff; }
.fc-seg button:focus-visible { outline: 2px solid #55d6ff; }
.fc-num { display: flex; gap: 8px; margin: 12px 0 6px; }
.fc-num input { flex: 1 1 auto; min-width: 0; min-height: 46px; background: #060b18; color: #fff; border: 1px solid #2a3d63; border-radius: 10px; padding: 0 14px; font: inherit; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; -webkit-user-select: text; user-select: text; }
.fc-num input:focus { outline: none; border-color: #55d6ff; box-shadow: 0 0 0 3px rgba(85,214,255,0.2); }
.fc-num .fc-btn { min-height: 46px; }
.fc-note { min-height: 1.5em; font-size: 13px !important; }
.fc-note.warn { color: #ffd166 !important; }
.fc-link { background: none; border: 0; padding: 4px 0; color: #55d6ff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@keyframes fc-fade { from { opacity: 0; } }
@keyframes fc-pop { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes fc-spin { to { transform: rotate(360deg); } }
@keyframes fc-pulse { 50% { box-shadow: inset 0 0 0 3px rgba(85,214,255,0.25), 0 0 0 5px rgba(85,214,255,0.25); } }
@keyframes fc-shake { 20% { transform: translateX(-5px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }
@keyframes fc-toast { 0% { opacity: 0; transform: translate(-50%, -6px); } 8%, 82% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 0); } }
@media (max-width: 560px) {
  .fc { padding: 6px 2px 12px; }
  .fc-table { padding: 6px 5px; border-radius: 10px; }
  .fc-bar { margin-bottom: 8px; }
  .fc-info { gap: 10px; }
  .fc-tools { flex: 1 1 auto; justify-content: flex-end; }
  .fc-btn { padding: 0 12px; }
  .fc-help { font-size: 11.5px; padding: 0 4px; }
}
@media (max-width: 380px) { .fc-btn { padding: 0 10px; font-size: 13px; } .fc-info { gap: 8px; } .fc-lbl { display: none; } }
@media (prefers-reduced-motion: reduce) { .fc-scrim, .fc-sheet, .fc-card.fc-hint, .fc-pile.fc-hint-to, .fc-card.fc-shake, .fc-col.fc-hint-to .fc-card:last-child { animation: none; } .fc-toast.show { animation-duration: 2.4s; } }
/* ---- full screen: the table fills what the bar leaves; card size comes from width and height (see fit()) ---- */
.is-immersive .fc { display: flex; flex-direction: column; max-width: none; width: 100%; padding: 6px 0 max(6px, env(safe-area-inset-bottom, 0px)); }
.is-immersive .fc-bar { flex: none; margin: 0 0 6px; }
.is-immersive .fc-table { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 8px 10px; touch-action: none; }
.is-immersive .fc-help { display: none; }
.is-immersive .fc-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }
.is-immersive .fc-tableau, .is-immersive .fc-top { justify-content: center; }
@media (max-height: 500px) { .is-immersive .fc-bar { margin-bottom: 4px; } .is-immersive .fc-table { padding: 6px 8px; } }
/* wide (landscape phones): free cells 2x2 on the left, foundations 2x2 on the right, the columns get the full height */
.fc-table.fc-wide { display: grid; grid-template-columns: var(--cw) var(--cw) auto var(--cw) var(--cw); grid-template-rows: var(--ch) var(--ch) 1fr; gap: var(--gap); justify-content: center; align-content: start; }
.fc-wide .fc-top { display: contents; }
.fc-wide [data-pile="x0"] { grid-area: 1 / 1; } .fc-wide [data-pile="x1"] { grid-area: 1 / 2; } .fc-wide [data-pile="x2"] { grid-area: 2 / 1; } .fc-wide [data-pile="x3"] { grid-area: 2 / 2; }
.fc-wide [data-pile="f0"] { grid-area: 1 / 4; } .fc-wide [data-pile="f1"] { grid-area: 1 / 5; } .fc-wide [data-pile="f2"] { grid-area: 2 / 4; } .fc-wide [data-pile="f3"] { grid-area: 2 / 5; }
.fc-wide .fc-tableau { grid-column: 3; grid-row: 1 / span 3; margin: 0 calc(var(--gap) * 1.6); }
.fc-wide .fc-drag, .fc-wide .fc-toast, .fc-wide .fc-fx { grid-area: auto; }
