/*
======================================================================
  5150 SHIP SHEET  -  THIS TOOL'S OWN LOOK  (ships.css)
======================================================================
  Most of the look (the page, form, boxes, lines, tables and printing)
  is the Character Generator's, in ../characters/characters.css, so
  the ship sheet matches your Star's sheet. This file only adds:
    1. THE FORM     the crew and log rows, the damage counters
    2. THE SHEET    page 1's layout, the big numbers and damage squares
======================================================================
*/


/* ------------------------------------------------------------------
   1. THE FORM
------------------------------------------------------------------ */
.with-button { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-top: 2px; }
.with-button input { width: 100%; }
.field-row.four { grid-template-columns: repeat(4, 1fr); }
.editor input:disabled { opacity: 0.6; }

.crew-row { grid-template-columns: 2fr 1.2fr 0.7fr 0.7fr 0.7fr auto; }
.crew-row .wide { grid-column: 1 / -2; }
.log-row { grid-template-columns: auto 1fr auto; }
.field-row.three { grid-template-columns: 0.8fr 0.8fr 1.4fr; }

/* The cargo manifest rows: Kind, what, how many, remove; then where to, value, Contraband, Delivered. */
.cargo-row { grid-template-columns: 1.1fr 2fr 0.8fr auto; }
.cargo-row .wide { grid-column: 1 / -2; }
.cargo-more { display: grid; grid-template-columns: 1.6fr 1fr auto auto; gap: 6px; align-items: center; }
.cargo-more .check { margin: 0; white-space: nowrap; }

/* The Long Jump's result, under its buttons. */
.jump-result span { display: block; margin-top: 4px; }
.jump-result b { color: var(--ink); }
.log-date { font-size: 13px; color: var(--ui-soft); white-space: nowrap; }

.damage-row { display: grid; grid-template-columns: 1fr auto 2.4em auto; gap: 8px; align-items: center; margin-bottom: 6px; color: var(--ui-text); }
.damage-row b { text-align: center; font-size: 20px; color: var(--ink); }
.hint.warn { color: var(--accent); }

@media (max-width: 480px) {
  .field-row.four { grid-template-columns: 1fr 1fr; }
  .crew-row { grid-template-columns: 1fr 1fr 1fr; }
  .field-row.three, .cargo-more { grid-template-columns: 1fr 1fr; }
}


/* ------------------------------------------------------------------
   2. THE SHEET (full size: 1400 x 987)
   Page 1: numbers and costs | registry and Captain | crew roster,
   with the notes strip across the bottom.
------------------------------------------------------------------ */
.ship-grid {
  display: grid;
  grid-template-columns: 340px 1fr 600px;
  grid-template-rows: 1fr 118px;
  gap: 22px;
  height: 780px;
}
.ship-col { display: flex; flex-direction: column; gap: 22px; min-height: 0; }
.ship-col > .grow { flex: 1; }
.ship-notes { grid-column: 1 / -1; }

/* The four big numbers, two by two. */
.ship-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ship-stat { padding: 24px 6px 10px; }
.ship-stat .num { display: inline-block; font-size: 64px; }
.ship-stat .of { margin-left: 6px; font-size: 22px; color: var(--ink-dim); }
.ship-stat .box-title { font-size: 15px; letter-spacing: 0.12em; }

/* A square per point of Thrust or Hull. A crossed square is damage. */
.dmg-boxes { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.dmg-boxes .tick { width: 22px; height: 22px; }
.dmg-boxes .tick.hit {
  background:
    linear-gradient(45deg, transparent 44%, var(--accent) 44%, var(--accent) 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, var(--accent) 44%, var(--accent) 56%, transparent 56%);
  border-color: var(--accent);
}
[data-theme="print"] .ship-stat .of { color: #ccc; }
[data-theme="print"] .dmg-boxes .tick { border-color: #fff; }
[data-theme="print"] .dmg-boxes .tick.hit {
  background:
    linear-gradient(45deg, transparent 44%, #fff 44%, #fff 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, #fff 44%, #fff 56%, transparent 56%);
}

/* The crew roster and log tables. */
/* CREW: two lines per person, with a solid line between people. */
.crew-table td { height: 41px; }
.crew-table tr.member-start td { border-top: 2px solid var(--frame); }
.crew-table .crew-name { color: var(--accent); }
.ship-log td { height: 43px; }

/* PAGE 2: where it is and the cargo manifest (left), the log (right). */
.ship-p2 { display: grid; grid-template-columns: 560px 1fr; gap: 22px; height: 780px; }
.ship-p2 > .box { min-height: 0; }
.manifest-table td { height: 41px; }
.manifest-table tr.member-start td { border-top: 2px solid var(--frame); }
.ship-log td.wrap { font-size: 21px; }
.ship-log .log-when { color: var(--accent); }

/* EXTRA PAGES (3 on): the rest of the manifest and the earlier log, full width. */
.ship-extra { display: grid; height: 780px; }
.ship-extra > .box { min-height: 0; }

/* Printing: every page on its own sheet of paper, the last without a break after it. */
@media print {
  /* (characters.css stops the second-last frame breaking, for its Full Record; not wanted here) */
  body:not(.printing-record) .preview > .sheet-frame { break-after: page; }
  body:not(.printing-record) .preview > .sheet-frame:last-child { break-after: auto; }
}

/* The Arjade line in each page's footer (keeps its own capitals, like the terminal tools' line). */
.sheet-foot .sheet-brand { text-transform: none; color: var(--ink); white-space: nowrap; }
.sheet-foot .page-no { white-space: nowrap; }
.sheet-foot > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* SHIPYARD: the form's module and Risk rows, and the Systems page (page 3). */
.sy-head { margin: 12px 0 4px; color: var(--ui-text); font-weight: bold; }
.sy-row { grid-template-columns: auto 1fr auto auto; align-items: center; }
.sy-row .hint { margin: 0; }
.ship-sys { display: grid; grid-template-columns: 430px 1fr; gap: 22px; height: 780px; }
.ship-sys .entry { margin-bottom: 8px; }
.ship-sys .entry .text { font-size: 19px; }
.ship-sys .sys-month { display: flex; flex-wrap: wrap; gap: 6px 26px; font-size: 22px; }
.ship-sys .sys-month b { margin-left: 6px; }
.ship-sys.one { grid-template-columns: 1fr; }
.field-row.sy-risk-row { grid-template-columns: auto 1fr auto; }
@media (max-width: 480px) { .field-row.sy-risk-row { grid-template-columns: 1fr; } }

/* THE SHIPYARD BROKER inside the form. */
#ship-broker .broker p { margin: 0 0 6px; color: var(--ui-text); }
#ship-broker .broker-choices { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
#ship-broker .broker-choices label { display: flex; flex-direction: column; gap: 2px; }
#ship-broker .g-warn { color: var(--accent); }
#ship-broker .term-dim { color: var(--ui-hint); }
