/* Better player list layout for mobile */
#player_list {
  grid-template: auto / 400px 165px 165px;
  gap: 0;
  font-size: 40px;
  width: auto;
  justify-items: initial;
  border-collapse: collapse;
}

.player_list_header {
  font-size: 26px;
  font-weight: bold;
  padding: 12px 8px;
  border: 1px solid #666666 !important;
  outline: none !important;
}

.player_row {
  padding: 12px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid #666666 !important;
  outline: none !important;
}

.player_row.name {
  white-space: nowrap;
}

.player_row.squares,
.player_row.winnings {
  text-align: center;
}

/* Highlight winners more prominently */
.player_winner {
  font-weight: bold;
}

/* Larger input fields for better touch targets */
input[type="text"],
input[type="number"],
select {
  font-size: 24px !important;
  min-height: 56px;
  padding: 12px;
}

textarea {
  font-size: 24px !important;
  line-height: 1.6;
  padding: 12px;
}

input[type="checkbox"] {
  width: 32px;
  height: 32px;
}

.page_wrapper {
  grid-template: 40px 1fr / 40px 1fr;
}

.superbowl_logo {
  height: 100%;
  width: 100%;
}

.nfl_logo {
  width: 60px;
  height: 80px;
}

.squares_wrapper {
  min-height: 850px;
}

.square {
  font-family: 'Roboto Condensed', sans-serif;
  padding: 3px;
}

.square_status {
  font-size: inherit;
}

.square_number {
  font-size: 24px;
}

.taken {
  font-size: 24px;
}

.square_winner {
  font-size: 14px; 
}

.current {
  font-size: 11px;
}

.afc_team {
  height: 40px;
}

.nfc_team {
  height: 40px;
}

.afc_team_name,
.nfc_team_name {
  font-size: 24px;
}

.nfc_header, 
.afc_header {
  font-size: 21px;
}

.admin_pane {
  padding: 8px;
  gap: 8px;
}

/* Full-screen forms on mobile - no dragging */
.form_wrapper {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto;
  bottom: auto;
  width: 80vw !important;
  height: 80vh !important;
  max-height: 80vh !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) !important;
  grid-template-rows: auto 1fr 75px;
  overflow: hidden;
}

/* Fix form panel layout for mobile */
.form_panel {
  grid-template-columns: 1fr auto !important;
  padding: 0px;
  align-items: center;
  height: auto;
}

.form_pane {
  display: flex;
  gap: 10px;
  margin: 4px 0 -6px 10px;
  padding: 4px;
  align-items: flex-start;
}

.form_selected,
.form_not_selected {
  margin: 0 !important;
  -webkit-tap-highlight-color: transparent;
}

.form_selected {
  padding-bottom: 6px !important;
}

/* Remove sticky hover/active states on mobile tabs */
.form_selected:hover,
.form_not_selected:hover,
.form_selected:active,
.form_not_selected:active,
.form_selected:focus,
.form_not_selected:focus {
  background: inherit !important;
  outline: none !important;
}

.form_selected:hover,
.form_selected:active,
.form_selected:focus {
  background: #CCCCCC !important;
}

.form_not_selected:hover,
.form_not_selected:active, 
.form_not_selected:focus {
  background: #ededed !important;
}

/* Hide drag handle on mobile */
.form_drag {
  display: none;
}

/* Larger close button for easier tapping */
.form_close {
  font-size: 52px;
  padding: 4px;
  min-width: 52px;
  min-height: 52px;
  margin: 0;
  z-index: 100;
  cursor: pointer;
  position: relative;
}

.form {
  grid-template-rows: 44px 1fr;
  overflow: hidden;
  display: grid;
  height: 100%;
  max-height: 100%;
}

/* MUCH larger text for editing forms - with proper scrolling */
.form_inner {
  height: 100% !important;
  max-height: 100%;
  width: 100%;
  font-size: 24px !important;
  line-height: 1.6;
  padding: 16px;
  font-family: monospace;
  overflow-y: auto !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  touch-action: pan-y;
}

/* Config form also needs scrolling */
#config_form {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  max-height: 100%;
  touch-action: pan-y;
}

/* Keep submit button visible at bottom */
.submit {
  width: 100%;
  height: 64px;
  max-height: 64px;
  margin: 0;
  border-radius: 0;
  flex-shrink: 0;
}

/* Prevent body scroll when form is open */
body:has(.form_wrapper[style*="display: grid"]) {
  overflow: hidden;
}

/* Larger text for config inputs */
.config_input,
.config_textarea {
  font-size: 24px !important;
  padding: 12px;
  min-height: 56px;
}

/* Larger touch targets for admin buttons */
.button {
  width: 56px;
  height: 56px;
  font-size: 48px;
  padding: 4px;
  border-width: 2px;
}

/* Remove sticky hover/focus states on mobile buttons in admin_pane, but allow brief active feedback */
.admin_pane .button:hover,
.admin_pane .button:focus {
  background: #FFFFFF !important;
  color: #999999 !important;
  outline: none !important;
}

.admin_pane .button:active {
  background: #999999 !important;
  color: #FFFFFF !important;
}

.directions {
  font-size: 28px;
  padding: 8px;
}

/* Larger submit button */
.submit {
  height: 60px;
  font-size: 32px;
  font-weight: bold;
}

.scores_wrapper {
  grid-template: 270px 200px 40px 1fr / 1fr;
  justify-content: center;
  grid-row: 3;
  grid-column: 2;
}

.score_box_header {
  font-size: 28px;
}

#scores_grid {
  font-size: 40px;
  grid-template: repeat(3, 60px) / 300px repeat(5, 85px);
  width: 730px;
}

.score_legend {
  width: 730px;
  font-size: 24px;
  margin-top: 4px;
}

.auto_refresh {
  font-size: 28px;
}

#autoRefreshCheckbox + label {
  font-size: 28px;
}

.rules_wrapper {
  margin: 25px 0;
  font-size: 40px;
}

.example_list {
  position: relative; 
  left: 40px;
}

.example {
  top: 485px;
  left: 200px;
}
