* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #013220;
  color: #f5f5f5;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0.6rem 0.8rem;
  background: #004d40;
  border-bottom: 2px solid #00796b;
}

.app-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.header-buttons {
  display: flex;
  gap: 0.5rem;
}

.history-row .btn {
  margin-bottom: 0.3rem;
}

.btn {
  height: 36px;        /* MATCHES End Round perfectly */
  line-height: 36px;   /* vertically centers text/arrows */
  padding: 0 0.6rem;   /* keep horizontal padding only */
  display: flex;
  align-items: center;
  justify-content: center;
}

.arrow-scale {
  display: flex;             /* make the span a flexbox */
  align-items: center;       /* vertically center arrow */
  justify-content: center;   /* horizontally center arrow */

  font-size: 1.8rem;         /* base arrow size */
  transform: scale(3);       /* resize arrow */
  transform-origin: center;

  height: 36px;              /* same as button height */
  line-height: 36px;         /* ensures consistent centering */
}

.main-scroll {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.arrow-btn {
  color: white;
}

.uniform-btn {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.screen {
  flex: 0 0 100%;
  max-width: 100%;
  padding: 0.8rem;
  scroll-snap-align: start;
}

h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.0rem;
}

.panel {
  background: #024731;
  border-radius: 0.75rem;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  border: 1px solid #0b8a6d;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.field-group {
  margin-bottom: 0.6rem;
}

.field-group label {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
}

.field-row {
  display: flex;
  gap: 0.75rem;
}

.field-row .field-group {
  flex: 1;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-size: 1.0rem;
}

.radio-row input {
  margin-right: 0.25rem;
}

.suit-row {
  display: flex;
  gap: 0.25rem;
}

.suit-btn {
  border: 1px solid yellow;
  border-radius: 8px;
  background: #004d40;
  color: white;
  font-size: 0.85rem;
  padding: 6px 12px;
  margin: 3px;
  cursor: pointer;
}

.suit-btn.active {
  background: yellow;
  color: black;
  border: 1px solid yellow;
}

.yellowButton {
  background: yellow;
  color: black;
  font-weight: 700;
  border: 1px solid yellow;
}

.level-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.arrow-btn {
  font-size: 1.6rem;   /* bigger arrow */
  color: white;        /* white arrow */
}

.level-btn {
  border: 1px solid yellow;
  border-radius: 8px;
  background: #004d40;
  color: white;
  font-size: 0.85rem;
  padding: 6px 10px;
  margin: 3px;
  cursor: pointer;
}

.level-btn.active {
  background: yellow;
  color: black;
  border: 1px solid yellow;
}

.delineation {
  text-align: center;
  margin: 0.5rem 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffe082;
  border-top: 1px solid #ffa000;
  border-bottom: 1px solid #ffa000;
  padding: 0.36rem 0;
}

.center {
  text-align: center;
}

.result-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0.25rem 0;
}

.btn-circle {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 2px solid #ffcc80;
  background: #e65100;
  font-size: 1.7rem;
  color: #fff3e0;
}

.delta-display {
  min-width: 2.7rem;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
}

.preview-box {
  background: #012218;
  border-radius: 0.4rem;
  border: 1px solid #0b8a6d;
  padding: 0.5rem;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.button-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn {
  flex: 1;
  padding: 0.5rem 0.6rem;
  border-radius: 0.6rem;
  border: none;
  font-size: 1.0rem;
  font-weight: 700;
}

.btn.small {
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid #ffcc80;
  color: #ffe0b2;
}

.btn.primary {
  background: #43a047;
  color: #e8f5e9;
}

.btn.danger {
  background: #e53935;
  color: #ffebee;
}

.totals-row {
  display: flex;
  justify-content: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.3rem;
}

.totals-side {
  flex: 1;
}

.totals-label {
  font-size: 0.85rem;
  color: #c8e6c9;
}

.totals-value {
  font-size: 1.3rem;
  font-weight: 700;
}

.totals-sub {
  font-size: 1.3rem;
  font-weight: 600;
  color: #ffe082;
  margin-top: 0.15rem;
}

.last-hand {
  font-size: 0.85rem;
  color: #fff9c4;
  margin-top: 0.3rem;
}

/* SCORECARD (slide right) */

.scorecard {
  font-size: 1.0rem;
}

/* New grid layout to align the above/below line across both columns */
.scorecard-grid {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* Align header, above-the-line, and below-the-line columns with more space between We and They */
.scorecard-header-row,
.scorecard-above-row,
.scorecard-below-row {
  display: flex;
  gap: 1.0rem;
}


.scorecard-header-cell,
.scorecard-above-row .scorecard-column,
.scorecard-below-row .scorecard-column {
  flex: 1;
}

.score-list {
  min-height: 3rem;
}

.score-entry {
  display: flex;
  justify-content: flex-start;
  padding: 0.12rem 0;
  min-height: 1.1rem;
}


.score-entry span {
  font-size: 0.86rem;
  white-space: nowrap;
}


.score-list.above {
  margin-bottom: 0.1rem;
}

/* Continuous line across both columns */
.hline-full {
  border-top: 2px solid #42a5f5;
  margin: 0.3rem 0 0.45rem 0;
}

.game-hline {
  border-top: 2px solid #ffe082;
  margin: 0.3rem 0 0.45rem 0;
}


/* Divider between completed games in below-the-line area */
.game-divider {
  border-top: 2px solid #ffe082;
  margin: 0.25rem 0 0.35rem 0;
}

.score-total-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.4rem;
  font-weight: 600;
  font-size: 1.0rem;
}

/* HAND HISTORY */

.history-list {
  max-height: 40vh;
  overflow-y: auto;
  border-radius: 0.35rem;
  border: 1px solid #0b8a6d;
  background: #012218;
}

.history-item {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #024731;
  font-size: 0.86rem;
}

.history-item:last-child {
  border-bottom: none;
}

/* OVERLAY */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  background: #024731;
  border-radius: 0.75rem;
  padding: 1rem;
  max-width: 22rem;
  border: 1px solid #0b8a6d;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}

.overlay-content h2 {
  margin-top: 0;
}

.overlay-content #overlayText {
  font-size: 1.0rem;
  margin-bottom: 0.75rem;
}


.score-entry.placeholder span { visibility: hidden; }


.scorecard-header-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 0.4rem;
}

.icon-button {
  background: transparent;
  border: none;
  color: #ffe082;
  font-size: 1.3rem;
  padding: 0.1rem 0.3rem;
  cursor: pointer;
}

.icon-button:focus {
  outline: 2px solid #ffcc80;
  outline-offset: 2px;
}

.text-input {
  width: 100%;
  padding: 0.35rem 0.45rem;
  border-radius: 0.45rem;
  border: 1px solid #0b8a6d;
  background: #012218;
  color: #f5f5f5;
  font-size: 1.0rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.5fr 0.9fr 1.5fr 0.9fr;
  gap: 0.3rem 0.5rem;
  margin-bottom: 0.75rem;
}

.settings-grid-header {
  text-align: center;
  font-weight: 600;
  font-size: 1.0rem;
  color: #ffe082;
}

.settings-grid-label {
  display: flex;
  align-items: center;
  font-size: 0.86rem;
}

.app-title-row {
  display: flex;
  
  align-items: center;
  width: 100%;
}

.city-select-btn {
  border-radius: 0.6rem;
  border: 1px solid #ffcc80;
  background: transparent;
  color: #ffe0b2;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.screen-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}


.screen-header-row .btn {
  flex: 0;
  white-space: nowrap;
}




/* v6.3: enlarge We/They headings on scorecard to match app title */
.scorecard-header-cell h3 {
  font-size: 1.2rem;
}


/* v6.3: larger Level and Strain buttons with more spacing */
.level-row,
.suit-row {
  display: flex;
  gap: 0.4rem;
}

.level-btn {
  border: 1px solid yellow;
  border-radius: 8px;
  background: #004d40;
  color: white;
  font-size: 0.85rem;
  padding: 6px 10px;
  margin: 3px;
  cursor: pointer;
}

.suit-btn {
  border: 1px solid yellow;
  border-radius: 8px;
  background: #004d40;
  color: white;
  font-size: 0.85rem;
  padding: 6px 12px;
  margin: 3px;
  cursor: pointer;
}

/* v6.4 strain buttons same size as level buttons */
.suit-btn {
  border: 1px solid yellow;
  border-radius: 8px;
  background: #004d40;
  color: white;
  font-size: 0.85rem;
  padding: 6px 12px;
  margin: 3px;
  cursor: pointer;
}

/* v6.4 enlarge bottom We/They */
.scorecard-header-cell h3 {
  font-size: 1.2rem !important;
}

/* v6.4 highlight selected Level/Strain yellow */
.level-btn.active, .suit-btn.active {
  background: yellow;
  color: black;
  border: 1px solid yellow;
}


/* v6.5: force strain buttons same size as level buttons */
.suit-btn {
  border: 1px solid yellow;
  border-radius: 8px;
  background: #004d40;
  color: white;
  font-size: 0.85rem;
  padding: 6px 12px;
  margin: 3px;
  cursor: pointer;
}

/* v6.5: enlarge We/They headings on scorecard */
.scorecard-header-cell h3 {
  font-size: 1.4rem !important;
}

/* v6.7: enlarge bottom We/They labels to match title size */
.totals-label {
  font-size: 1.2rem !important;
  font-weight: 700;
}


/* v6.8: center Level & Strain buttons without stretching full width */
.level-row,
.suit-row {
  justify-content: flex-start;
}

/* v6.8: prevent buttons from stretching like a justified column */
.level-btn,
.suit-btn {
  border: 1px solid yellow;
  border-radius: 8px;
  background: #004d40;
  color: white;
  font-size: 0.85rem;
  padding: 6px 12px;
  margin: 3px;
  cursor: pointer;
}


/* Screen lock overlay for tap protection */
.lock-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  display: none;
  z-index: 5;
}

.lock-overlay.on {
  display: block;
}

#lockBtn {
  position: relative;
  z-index: 10;
}


.city-name-display {
  font-size: 1.2rem;
  color: inherit;
  margin-left: 0.35rem;
 font-style: italic; }




.app-header .app-title-row {
  justify-content: flex-start;
}
.tricks-made-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
}

.tricks-made-label {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-size: 0.84rem;
  text-align: right;
}

.totals-main {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.totals-vul {
  font-size: 1.3rem;
  font-weight: 700;
}
.scorecard-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scorecard-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.scorecard-header-bar .header-buttons {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.score-entry span:last-child {
  margin-left: auto;
  text-align: right;
}

.score-total-row span:last-child {
  margin-left: auto;
  text-align: right;
}


.screen-scorecard {
  display: flex;
  flex-direction: column;
}

.scorecard-footer {
  margin-top: auto;
  text-align: center;
  font-size: 0.8rem;
  padding-top: 0.4rem;
  color: #ffe082;
}


.tricks-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tricks-row {
  display: flex;
  gap: 0.6rem;
}

.tricks-btn {
  flex: 1;
  min-width: 2.40rem;
  border-radius: 0.5rem;
  border: 1px solid yellow;
  background: #004d40;
  color: white;
  font-size: 0.80rem;
  padding: 0.36rem 0;
}

.tricks-btn.active {
  background: yellow;
  color: black;
}


@media (min-width: 900px) {
  .main-scroll {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    overflow-x: visible;
  }
  .screen {
    min-width: 0 !important;
    flex: 1 1 50%;
  }
}

#lockBtn { padding-left:2rem; padding-right:0; }

.history-item { display:flex; align-items:center; }
.history-item button { margin-left:auto; }

.history-item button {
    flex: 0 0 auto !important;
    width: auto !important;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* y0181 custom radio styling */
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid yellow;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  background: transparent;
  cursor: pointer;
  margin-right: 0.25rem;
}

input[type="radio"]:checked {
  background: yellow;
  border-color: yellow;
}

#handNumberDisplay {
  font-size: 1.5rem;
  margin-top: -8px;   /* Pulls it upward so the row doesn’t stretch */
}

.history-item {
    display: flex;
    align-items: center;
}

.history-item button {
    margin-left: auto !important;
}

html, body, .main-scroll {
    touch-action: pan-y !important;   /* allow ONLY vertical scrolling */
}

/* Container for vertical swipe button + hand history panel */
.history-with-button {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

/* Vertical Swipe Left button */
.vertical-swipe-btn {
  writing-mode: vertical-rl;     /* text vertical top→bottom */
  transform: rotate(180deg);     /* make text readable */
  background: #42a5f5;         /* BLUE */
  color: white;
  border: 2px solid #42a5f5;   /* BLUE */
  border-radius: 8px;
  padding: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  min-width: 36px;               /* matches your normal button height */
}

/* Shrink the history panel to make room for the vertical button */
.history-panel {
  flex: 1;                       /* take remaining width */
  margin-left: 0.5rem;           /* spacing */
}

/* Blue Swipe Right button */
.swipe-blue {
  background: #42a5f5;
  color: white;
  border: 1px solid #42a5f5;
  font-weight: 700;
}

.lock-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e53935;         /* red like before */
  color: white;
  border: none;
  font-size: 1.6rem;            /* big icon */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
 
.lock-btn {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    width: auto;
    height: auto;
}

/* Trumps row with padlock on the right */
.trumps-row {
  display: flex;
  align-items: center;
}

.trumps-row #strainButtons {
  margin-left: 0;
  margin-right: auto;   /* pushes padlock to the right */
}

/* small spacing from the NT buttons */
.trumps-row .lock-btn {
  margin-left: 0.75rem;
}
