/* The Shipyard; base styles come from /shared.css, ships from /ship.js. */

.page.wide { max-width: 1040px; }
.section-title { margin: 24px 0 12px; }
.yard { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.yard .card { margin-bottom: 0; }
@media (max-width: 800px) { .yard { grid-template-columns: minmax(0, 1fr); } }

.preview-card { position: sticky; top: calc(var(--top-bar-h, 0px) + 16px); }
@media (max-width: 800px) { .preview-card { position: static; } }
.preview { border-radius: 12px; overflow: hidden; background: radial-gradient(ellipse at 50% 20%, #24345a, #0b1428 70%); }
.name-form { margin-top: 12px; }
.name-form label { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.name-row { display: flex; gap: 8px; }
.name-row input {
  flex: 1; min-width: 0; padding: 8px 10px; font: inherit; font-weight: 700; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(0,0,0,.35); color: var(--gold);
}
.name-row input:focus { outline: 2px solid var(--bolt); }
.msg { min-height: 1.2em; margin: 8px 0 0; font-size: .9rem; }
.msg.ok { color: var(--gold); }
.msg.err { color: var(--error); }

.parts h3 { margin: 14px 0 8px; font-size: 1.4rem; }
.parts h3:first-child { margin-top: 0; }
.forced-note { margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; font-size: .85rem; border: 1px solid rgba(142, 68, 173, .6); background: rgba(142, 68, 173, .15); }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px;
  border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.04); text-align: center;
}
.item:hover:not(:disabled) { border-color: var(--bolt); }
.item.on { border: 2px solid var(--gold); background: rgba(246, 195, 67, .14); }
.item.on::after { content: "✓"; position: absolute; top: 4px; right: 6px; color: var(--gold); font-weight: 800; }
.item.for-sale { border-style: dashed; }
.item.trying { border: 2px dashed var(--bolt); background: rgba(124, 196, 255, .12); }
.buy-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.buy-bar #buy-text { flex: 1 1 100%; font-size: .9rem; }
.item .swatch { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); display: grid; place-items: center; font-size: 1.4rem; overflow: hidden; }
.item .swatch.none { color: var(--muted); font-size: 1.1rem; border-style: dashed; }
.item .swatch img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.item .i-name { font-size: .8rem; font-weight: 700; line-height: 1.15; }
.item .i-sub { font-size: .7rem; color: var(--muted); }
.item.for-sale .i-sub { color: var(--gold); }
.item.locked { border-style: dashed; }
.item.locked .swatch { filter: grayscale(.8) brightness(.7); }
.item.trophy:not(.locked):not(.on) { border-color: rgba(246, 195, 67, .45); }

/* Trophy cabinet */
.trophy-card { margin-top: 16px; }
.trophy-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.trophy-head h2 { margin: 0; }
.trophy-card .hint { font-size: .85rem; color: var(--muted); margin: 6px 0 10px; }
.trophies { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px 16px; }
@media (max-width: 560px) { .trophies { grid-template-columns: minmax(0, 1fr); } }
.trophies li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.trophies .t-try { padding: 0; border: none; background: none; border-radius: 50%; flex: none; }
.trophies .swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); display: grid; place-items: center; font-size: 1.4rem; overflow: hidden; }
.trophies li:not(.earned) .swatch { filter: grayscale(.8) brightness(.7); }
.trophies li.earned .swatch { border-color: var(--gold); }
.trophies li.fresh .swatch { box-shadow: 0 0 14px var(--gold); }
.trophies .t-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trophies .t-name { font-weight: 700; font-size: .9rem; }
.trophies .t-slot { font-weight: 400; font-size: .72rem; color: var(--muted); }
.trophies .t-text { font-size: .8rem; color: var(--muted); }
.trophies .t-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 2px; }
.trophies .t-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dark, #b8860b), var(--gold)); }
.trophies .t-prog { flex: none; font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; min-width: 3.5em; }
.trophies li.earned .t-prog { font-size: 1.2rem; }

.fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
@media (max-width: 560px) {
  .fleet { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .boat { padding: 6px; }
  .boat .b-name { font-size: 1.05rem; }
}
.boat { margin: 0; padding: 10px; text-align: center; }
.boat.me { border-color: var(--gold); }
.boat .ship-wrap { border-radius: 10px; overflow: hidden; background: radial-gradient(ellipse at 50% 20%, #24345a, #0b1428 70%); }
.boat .b-name { font-family: var(--display); font-size: 1.3rem; color: var(--gold); margin-top: 6px; overflow-wrap: anywhere; }
.boat .b-captain { font-size: .85rem; color: var(--muted); }
