/* TeamBoard: field board shared by the Dex Team Preview and the All-Star Dream Team builder */
.tb-field { position: relative; aspect-ratio: 1500 / 1040; border-radius: 14px; overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 50% 42%, rgba(255,255,255,.07), transparent 70%),
    repeating-linear-gradient(45deg, rgba(0,0,0,.05) 0 2px, transparent 2px 4px),
    radial-gradient(circle at 50% 40%, #1f5c3a, #123a25 70%, #0c2a1a);
  border: 10px solid #5a3a1e; border-image: linear-gradient(160deg, #8a5a2b, #4a2c12 40%, #7a4f26 60%, #3e2410) 1;
  box-shadow: inset 0 0 40px rgba(0,0,0,.55), 0 10px 30px rgba(0,0,0,.5); }
.tb-diamond { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tb-diamond .g-out { fill: rgba(34,120,60,.35); } .tb-diamond .g-track { fill: none; stroke: rgba(161,98,7,.45); stroke-width: 26; }
.tb-diamond .g-dirt { fill: rgba(161,98,7,.38); } .tb-diamond .g-in { fill: rgba(34,120,60,.55); }
.tb-diamond .g-line { fill: none; stroke: rgba(255,255,255,.45); stroke-width: 4; } .tb-diamond .g-path { fill: none; stroke: rgba(255,255,255,.18); stroke-width: 3; }
.tb-diamond .g-mound { fill: rgba(161,98,7,.6); } .tb-diamond .g-base { fill: #f5f0e1; }
.tb-diamond .g-dug { fill: rgba(0,0,0,.35); stroke: rgba(255,255,255,.15); stroke-width: 3; }
.tb-pos { position: absolute; left: var(--x); top: var(--y); translate: -50% -50%; z-index: 1; }
.tb-pos:hover { z-index: 3; }

/* slots (preview) */
.tb-slot { position: relative; display: flex; flex-direction: column; align-items: center; cursor: pointer; font-family: 'Oswald', sans-serif; }
.tb-slot.empty { width: 92px; height: 132px; border: 2px dashed rgba(255,255,255,.35); border-radius: 8px; background: rgba(0,0,0,.28);
  color: #e5e7eb; justify-content: center; gap: 4px; font-size: 13px; letter-spacing: 1px; }
.tb-slot.empty i { font-style: normal; font-size: 26px; color: #fde68a; line-height: 1; }
.tb-slot.empty:hover, .tb-slot.on { border-color: #fde047; box-shadow: 0 0 0 3px rgba(253,224,71,.25), 0 0 18px rgba(253,224,71,.35); }
.tb-tag { font-size: 11px; letter-spacing: 1px; color: #fde68a; background: rgba(0,0,0,.6); padding: 1px 7px; border-radius: 4px; margin-bottom: 2px; }
.tb-card { zoom: .6; filter: drop-shadow(0 8px 12px rgba(0,0,0,.55)); }
.tb-slot.full.on .tb-card { filter: drop-shadow(0 0 12px rgba(253,224,71,.8)); }
.tb-x { position: absolute; top: 14px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #b91c1c; color: #fff;
  font-size: 11px; line-height: 20px; cursor: pointer; opacity: 0; transition: opacity .15s; z-index: 4; }
.tb-slot.full:hover .tb-x { opacity: 1; }
.tb-lock { position: absolute; top: 14px; left: -6px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(253,224,71,.5);
  background: rgba(0,0,0,.7); font-size: 11px; line-height: 20px; cursor: pointer; opacity: 0; transition: opacity .15s; z-index: 4; padding: 0; }
.tb-slot.full:hover .tb-lock, .tb-slot.locked .tb-lock { opacity: 1; }
.tb-slot.locked .tb-card { filter: drop-shadow(0 0 10px rgba(253,224,71,.65)); }
@media (hover: none) { .tb-lock, .tb-x { opacity: 1; } }

/* Team Preview overlay */
#tb-preview { position: fixed; inset: 0; z-index: 100050; background: rgba(2,8,6,.88); overflow: auto; padding: 14px; }
#tb-preview .tb-wrap { max-width: 1500px; margin: 0 auto; background: rgba(4,10,16,.92); border: 1px solid #22c55e66; border-radius: 12px; padding: 14px; }
.tb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.tb-title { flex: 1 1 260px; } .tb-title small { display: block; font-family: 'Oswald', sans-serif; color: #86efac; letter-spacing: 2px; font-size: 12px; }
.tb-name { background: transparent; border: 0; border-bottom: 2px solid #22c55e55; color: #fde68a; font-family: 'Alfa Slab One', serif; font-size: 26px; width: 100%; max-width: 460px; outline: none; }
.tb-ovr { text-align: center; border: 2px solid #eab308; border-radius: 8px; padding: 4px 14px; background: rgba(0,0,0,.4); font-family: 'Oswald', sans-serif; }
.tb-ovr small { display: block; color: #fde68a; font-size: 11px; letter-spacing: 1px; } .tb-ovr b { font-family: 'VT323', monospace; font-size: 34px; color: #fde047; line-height: 1; } .tb-ovr span { display: block; font-size: 11px; color: #cbd5e1; }
.tb-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tb-tools select { background: #0f1c16; color: #e5e7eb; border: 1px solid #22c55e66; border-radius: 6px; padding: 6px 8px; font-family: 'Oswald', sans-serif; font-size: 13px; }
.tb-btn { background: #13241c; color: #e5e7eb; border: 1px solid #22c55e66; border-radius: 6px; padding: 6px 10px; font-family: 'Oswald', sans-serif; font-size: 13px; letter-spacing: .5px; cursor: pointer; }
.tb-btn:hover { border-color: #86efac; }
.tb-btn.gold { background: linear-gradient(180deg, #f6d36b, #c9971f); color: #2a1a00; border-color: #fde68a; font-weight: 700; }
.tb-hint { font-family: 'Oswald', sans-serif; color: #cbd5e1; font-size: 14px; margin: 4px 0 10px; } .tb-hint b { color: #fde047; }
.tb-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.tb-rack { margin-top: 10px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.08); border-radius: 8px; padding: 8px; }
.tb-rack-t { font-family: 'Oswald', sans-serif; color: #86efac; letter-spacing: 2px; font-size: 13px; margin-bottom: 6px; }
.tb-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-deck { position: sticky; top: 0; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.08); border-radius: 8px; padding: 8px; max-height: calc(100vh - 60px); display: flex; flex-direction: column; }
.tb-deckgrid { overflow-y: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; justify-items: center; }
.tb-deckcard { zoom: .62; cursor: pointer; transition: transform .12s; } .tb-deckcard:hover { transform: translateY(-4px); }
.tb-empty { grid-column: 1 / -1; color: #94a3b8; font-family: 'Oswald', sans-serif; font-size: 14px; padding: 20px 6px; text-align: center; }

/* All-Star Dream Team builder: the lineup as a field */
.c162-asfield .tb-pos .c162-slot-item { margin: 0; }
.c162-asfield .tb-pos .c162-card-container, .c162-asfield .tb-pos .c162-empty-card-frame { zoom: .62; }
.c162-asfield .tb-pos .c162-slot-header-pill { margin-bottom: 2px; }

@media (max-width: 900px) {
  .tb-body { grid-template-columns: 1fr; }
  .tb-deck { position: static; max-height: 60vh; }
  /* Phones keep the field (user, 14 nov 2026): smaller cards in their real spots, taller field. */
  .tb-field { aspect-ratio: 3 / 4.4; border-width: 6px; }
  .tb-field .tb-at-CF { --y: 11% !important; } .tb-field .tb-at-SS, .tb-field .tb-at-2B { --y: 34.5% !important; } .tb-field .tb-at-3B, .tb-field .tb-at-1B { --y: 58% !important; } .tb-field .tb-at-P { --y: 60% !important; } .tb-field .tb-at-DH { --x: 13% !important; }
  .tb-field .tb-card { zoom: .4; } .tb-field .tb-slot.empty { width: 54px; height: 80px; font-size: 10px; }
  .tb-field .tb-tag { font-size: 9px; padding: 0 4px; }
  .tb-card { zoom: .5; } .tb-slot.empty { width: 76px; height: 108px; }
  .tb-deckgrid { grid-template-columns: repeat(3, 1fr); } .tb-deckcard { zoom: .5; }
}

/* All-Star builder: board on the left, card deck on the right */
.c162-asgrid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 12px; align-items: start; }
.c162-asdeck { position: sticky; top: 8px; background: rgba(4,10,16,.9); border: 1px solid #22c55e66; border-radius: 10px; padding: 8px;
  max-height: calc(100vh - 24px); display: flex; flex-direction: column; gap: 6px; }
.c162-asdeck.on { border-color: #fde047; box-shadow: 0 0 18px rgba(253,224,71,.25); }
.c162-asdeck-t { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-family: 'Oswald', sans-serif; color: #86efac; letter-spacing: 1px; font-size: 13px; }
.c162-asdeck.on .c162-asdeck-t { color: #fde047; }
.c162-asdeck-x { background: #13241c; color: #e5e7eb; border: 1px solid #22c55e66; border-radius: 5px; padding: 2px 8px; cursor: pointer; }
.c162-asdeck-sub { font-family: 'Oswald', sans-serif; color: #94a3b8; font-size: 12px; }
.c162-asdeck input { width: 100%; box-sizing: border-box; padding: 7px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.6); color: #fff; font-size: 13px; }
.c162-asdeck-grid { overflow-y: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; justify-items: center; }
.c162-asdeck-grid .c162-candidate-wrap { zoom: .6; cursor: pointer; transition: transform .12s; }
.c162-asdeck-grid .c162-candidate-wrap:hover { transform: translateY(-4px); }
.c162-asdeck-empty { grid-column: 1 / -1; color: #94a3b8; font-family: 'Oswald', sans-serif; font-size: 13px; padding: 18px 6px; text-align: center; }

@media (max-width: 900px) {
  .c162-asgrid { grid-template-columns: 1fr; }
  /* the deck becomes a sheet fixed at the bottom while you pick */
  .c162-asdeck { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 46vh; z-index: 9000; border-radius: 12px 12px 0 0; }
  .c162-asdeck:not(.on) { max-height: 30vh; }
  .c162-asmain { padding-bottom: 32vh; }
  .c162-asdeck-grid { grid-template-columns: repeat(4, 1fr); }
  .c162-asdeck-grid .c162-candidate-wrap { zoom: .48; }
  .c162-asfield .tb-pos .c162-card-container, .c162-asfield .tb-pos .c162-empty-card-frame { zoom: .5; }
  /* Team Preview on phones: deck as a bottom sheet too */
  #tb-preview { padding: 6px; } #tb-preview .tb-wrap { padding: 8px; }
  .tb-name { font-size: 20px; } .tb-tools { gap: 4px; } .tb-btn { padding: 5px 7px; font-size: 12px; }
  .tb-deck { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 34vh; z-index: 100060; border-radius: 12px 12px 0 0; background: rgba(4,10,16,.97); }
  .tb-board { padding-bottom: 36vh; }
  .tb-deckgrid { grid-template-columns: repeat(4, 1fr); } .tb-deckcard { zoom: .45; }
}
.tb-postabs { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
.tb-postabs button { font-family: 'Oswald', sans-serif; font-size: 12px; padding: 2px 7px; border-radius: 4px; cursor: pointer;
  background: rgba(253,224,71,.08); color: #fde68a; border: 1px solid rgba(253,224,71,.35); }
.tb-postabs button.on { background: #fde047; color: #1a1300; border-color: #fde047; }
#tb-zoom { position: fixed; inset: 0; z-index: 100100; background: rgba(0,0,0,.82); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
#tb-zoom .tb-zoom-card { zoom: 2.2; cursor: pointer; filter: drop-shadow(0 20px 40px rgba(0,0,0,.7)); }
#tb-zoom > small, #tb-zoom > div > small:not(.bk-car) { font-family: 'Oswald', sans-serif; color: #cbd5e1; font-size: 14px; }
@media (max-width: 900px) { #tb-zoom .tb-zoom-card { zoom: 1.6; } }

/* Random players mosaic (Team Preview) */
.tb-mosaic { margin: 6px 0 10px; padding: 8px 10px; background: rgba(0,0,0,.35); border: 1px solid #22c55e44; border-radius: 10px; }
.tb-mz-head { display: flex; align-items: center; justify-content: space-between; font-family: 'Oswald', sans-serif; color: #fde68a; letter-spacing: 1px; font-size: 13px; margin-bottom: 6px; }
.tb-mz-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.tb-mz { position: relative; border: 2px solid #475569; border-radius: 6px; background: #0b1220; padding: 0; cursor: pointer; overflow: hidden; transition: transform .12s, border-color .12s; }
.tb-mz i { display: block; width: 100%; aspect-ratio: 4 / 3; background-size: cover; background-position: center; image-rendering: pixelated; }
.tb-mz span { display: block; font-family: 'Oswald', sans-serif; font-size: 10.5px; color: #e5e7eb; padding: 2px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(0,0,0,.75); }
.tb-mz:hover { transform: translateY(-2px) scale(1.04); border-color: #fde047; z-index: 2; }
.tb-mz.r-uncommon { border-color: #22c55e; } .tb-mz.r-rare { border-color: #3b82f6; } .tb-mz.r-epic { border-color: #a855f7; } .tb-mz.r-legendary { border-color: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,.5); }
@media (max-width: 900px) { .tb-mz-grid { grid-template-columns: repeat(6, 1fr); } }
.dx2-mosaic { padding: 6px 16px 0; } .dx2-mosaic .tb-mosaic { margin: 4px 0 2px; }

/* Main menu card wall */
.mcw { margin: 26px auto 0; max-width: 1060px; }
.mcw-head { display: flex; align-items: center; justify-content: center; gap: 14px; font-family: 'Oswald', sans-serif; color: #fde68a; letter-spacing: 2px; font-size: 14px; margin-bottom: 8px; }
.mcw-roll { font-family: 'Oswald', sans-serif; font-size: 13px; letter-spacing: 1px; padding: 5px 12px; border-radius: 16px; border: 1.5px solid #fde047; background: rgba(253,224,71,.12); color: #fde68a; cursor: pointer; }
.mcw-roll:hover { background: rgba(253,224,71,.25); }
.mcw-row { display: flex; justify-content: center; align-items: flex-start; padding: 14px 0 24px; }
.mcw-card { border: 0; background: none; padding: 0; margin: 0 -10px; cursor: pointer; zoom: .74; transform: rotate(var(--r)) translateY(var(--y)); transform-origin: 50% 120%;
  transition: transform .18s ease, filter .18s ease; filter: drop-shadow(0 10px 14px rgba(0,0,0,.6)); animation: mcwIn .5s both; animation-delay: var(--d); position: relative; }
.mcw-card:hover { transform: rotate(0deg) translateY(-22px) scale(1.08); z-index: 5; filter: drop-shadow(0 18px 26px rgba(0,0,0,.7)); }
@keyframes mcwIn { from { opacity: 0; transform: translateY(60px) rotate(0deg); } to { opacity: 1; transform: rotate(var(--r)) translateY(var(--y)); } }
@media (max-width: 900px) { .mcw-row { justify-content: flex-start; overflow-x: auto; padding: 14px 16px 24px; } .mcw-card { zoom: .62; margin: 0 -6px; flex: 0 0 auto; } }
@media (prefers-reduced-motion: reduce) { .mcw-card { animation: none; } }
/* phones: the hand as a neat 3 x 3 grid (no fan, no sideways scroll) */
@media (max-width: 600px) {
  .mcw { max-width: 100%; margin-top: 18px; }
  .mcw-head { flex-direction: column; gap: 6px; font-size: 13px; }
  .mcw-row { display: grid !important; grid-template-columns: repeat(3, auto); justify-content: center; gap: 8px 6px; overflow: visible !important; padding: 8px 0 16px !important; }
  .mcw-card { zoom: .6 !important; margin: 0 !important; transform: none !important; animation-name: mcwInFlat; }
  .mcw-card:hover { transform: none !important; }
}
@keyframes mcwInFlat { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

/* drag to swap */
[data-tb-slot][draggable=true] { cursor: grab; }
.tb-dragging { opacity: .45; }
.tb-dropover { outline: 2px dashed #fde047; outline-offset: 3px; }

/* Phone fixes (14 nov 2026): the lock and X stay small (the global 40px touch rule made them huge
   squares over the card), and a long press opens the big card instead of selecting text. */
#tb-preview .tb-x, #tb-preview .tb-lock { min-height: 0 !important; min-width: 0 !important; padding: 0 !important; }
@media (max-width: 900px) { #tb-preview .tb-x, #tb-preview .tb-lock { width: 18px; height: 18px; line-height: 18px; font-size: 10px; top: 4px; } }
#tb-preview .tb-slot, #tb-preview .tb-deckcard { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Team Preview: backups strip + chemistry chips, kept quiet */
.tb-extras { margin: 4px 0 2px; opacity: .9; }
.tb-extras:empty { display: none; }
.tb-extras .c162-depth { margin: 0 0 4px; padding: 4px 6px; background: rgba(4,10,16,.5); }
.tb-extras .c162-chem2 { margin: 0; padding: 4px 6px; background: rgba(4,10,16,.5); border: 1px solid #1e293b; border-radius: 6px; }
