/* Room Game Center - Kırmızı & Siyah */

:root {
  --black: #0a0a0a;
  --black-soft: #141414;
  --black-card: #1a1a1a;
  --red: #c41e3a;
  --red-bright: #e63946;
  --red-dark: #9a1830;
  --red-glow: rgba(196, 30, 58, 0.35);
  --gray: #2a2a2a;
  --gray-text: #888;
  --white: #f0f0f0;
  --border: #333;
  --green: #22c55e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.5;
}

/* Giriş sayfası */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--black);
}

.login-screen[hidden] {
  display: none !important;
}

.login-box {
  width: 100%;
  max-width: 340px;
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--red-dark);
  text-align: center;
}

.login-box .logo-icon {
  display: block;
  font-size: 2rem;
  color: var(--red);
  margin-bottom: 0.5rem;
}

.login-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 0.25rem 0;
  letter-spacing: 0.05em;
}

.login-subtitle {
  font-size: 0.95rem;
  color: var(--gray-text);
  margin-bottom: 1.5rem;
}

.login-form .form-group {
  text-align: left;
  margin-bottom: 1rem;
}

.login-form .form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--gray-text);
  margin-bottom: 0.35rem;
}

.login-form .form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--white);
  background: var(--black-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.login-form .form-group input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--red-glow);
}

.login-error {
  font-size: 0.9rem;
  color: var(--red-bright);
  margin-bottom: 1rem;
}

.login-error[hidden] {
  display: none !important;
}

.btn-login {
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 1.05rem;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
  background: var(--red-bright);
  box-shadow: 0 0 20px var(--red-glow);
}

.app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  text-align: center;
  padding: 1.25rem 0;
  border-bottom: 2px solid var(--red);
  margin-bottom: 1.5rem;
}

.logo-icon {
  font-size: 1.5rem;
  color: var(--red);
  display: block;
  margin-bottom: 0.25rem;
}

.header h1 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: 0.05em;
}

.tagline {
  font-size: 0.9rem;
  color: var(--gray-text);
}

.main {
  flex: 1;
}

.tables-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.table-panel {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  border-top: 4px solid var(--red);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.table-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.table-badge {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--red-bright);
}

.table-status {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  background: var(--gray);
  color: var(--gray-text);
}

.table-panel.active .table-status {
  background: rgba(34, 197, 94, 0.2);
  color: var(--green);
}

.timer-wrap {
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.05em;
}

.table-panel.active .timer {
  color: var(--red-bright);
  text-shadow: 0 0 20px var(--red-glow);
}

.total-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.total-label {
  font-size: 0.75rem;
  color: var(--gray-text);
}

.table-total {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--red-bright);
}

.extras-section {
  width: 100%;
  background: var(--black-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}

.extras-title {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-text);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.extras-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.extras-row:last-child {
  margin-bottom: 0;
}

.extras-name {
  min-width: 2.5rem;
  color: var(--white);
}

.extra-qty {
  width: 3rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.9rem;
  color: var(--white);
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}

.extras-unit {
  font-size: 0.8rem;
  color: var(--gray-text);
}

.last-result {
  font-size: 0.85rem;
  color: var(--gray-text);
  text-align: center;
  min-height: 1.5rem;
}

.last-result .price {
  color: var(--red-bright);
  font-weight: 600;
}

.bill-box {
  width: 100%;
  background: var(--black-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin: 0.25rem 0;
}

.bill-box[hidden] {
  display: none !important;
}

.bill-row {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.bill-row:last-child {
  margin-bottom: 0;
}

.bill-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-text);
  margin-bottom: 0.25rem;
}

.bill-row .bill-total {
  color: var(--red-bright);
}

.bill-persons {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.bill-hint {
  font-size: 0.8rem;
  color: var(--gray-text);
  margin-bottom: 0.5rem;
}

.bill-person-block {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.bill-person-block:last-child {
  margin-bottom: 0;
}

.bill-person-title {
  font-weight: 600;
  color: var(--red);
  margin-bottom: 0.4rem;
}

.bill-person-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.bill-person-row:last-child {
  margin-bottom: 0;
}

.bill-person-qty {
  width: 2.5rem;
  padding: 0.25rem 0.3rem;
  font-size: 0.85rem;
  color: var(--white);
  background: var(--black-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
}

.bill-person-total {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border);
  font-weight: 600;
  color: var(--red-bright);
}

.bill-split {
  width: 100%;
  padding: 0.4rem 0.5rem;
  font-size: 1rem;
  color: var(--white);
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.bill-per-person {
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

/* Tam ekran hesap sayfası */
.bill-page {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.bill-page[hidden] {
  display: none !important;
}

.bill-page-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.bill-page-content {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--red-dark);
}

.bill-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--red);
}

.bill-page-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--red-bright);
  margin: 0;
}

.bill-page-close {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gray-text);
  background: var(--gray);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.bill-page-close:hover {
  color: var(--white);
  background: var(--red-dark);
}

.bill-page-body .bill-row {
  margin-bottom: 0.75rem;
}

.bill-page-body #billPageTotal {
  color: var(--red-bright);
  font-size: 1.25rem;
}

.bill-page-body #billPageSplit {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  color: var(--white);
  background: var(--black-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn {
  width: 100%;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-start {
  background: var(--red);
  color: var(--white);
}

.btn-start:hover {
  background: var(--red-bright);
  box-shadow: 0 0 16px var(--red-glow);
}

.btn-stop {
  background: var(--gray);
  color: var(--white);
  border: 1px solid var(--border);
}

.btn-stop:hover {
  background: #333;
  border-color: var(--red-dark);
}

.btn-bill {
  background: var(--gray);
  color: var(--white);
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.btn-bill:hover {
  border-color: var(--red-dark);
  color: var(--red-bright);
}

.btn[hidden] {
  display: none !important;
}

.history-section {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.history-section h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.history-list {
  list-style: none;
}

.history-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.history-list li:last-child {
  border-bottom: none;
}

.history-list .history-info {
  color: var(--gray-text);
}

.history-list .history-masa {
  color: var(--red);
  font-weight: 600;
  margin-right: 0.35rem;
}

.history-list .history-price {
  font-weight: 600;
  color: var(--red-bright);
}

.footer {
  margin-top: auto;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--gray-text);
  border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
  .tables-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .tables-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 380px) {
  .tables-grid {
    grid-template-columns: 1fr;
  }
}
