body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f5f5f5;
}

.container {
  max-width: 400px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  border-radius: 10px;
  box-shadow: 0 2px 10px #0001;
  padding: 5px 8px 52px 8px;
}

h2 {
  text-align: center;
  color: #238636;
  margin-top: 2px;
  margin-bottom: 8px;
  font-size: 1.1em;
}

.score-logo {
  display: block;
  margin: 0 auto 0 auto;
  width: 100px;
  height: 100px;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  object-fit: contain;
}

.brand-name {
  display: block;
  margin: 5px auto;
  height: 40px;
  width: auto;
}

.menu-btn {
  width: 100%;
  margin: 7px 0;
  padding: 10px 0;
  font-size: 1.07em;
  border-radius: 5px;
  border: none;
  background: #caf7d2;
  color: #222;
  font-weight: bold;
  cursor: pointer;
}

.menu-btn:hover {
  background: #b6eac7;
}

.form-group {
  margin-bottom: 10px;
}

label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

input, select {
  width: 100%;
  padding: 7px;
  border-radius: 4px;
  border: 1px solid #cce3d2;
  font-size: 0.98em;
  box-sizing: border-box;
}

.action-btn {
  width: 100%;
  padding: 11px 0;
  background: #238636;
  color: #fff;
  font-weight: bold;
  font-size: 1.07em;
  border: none;
  border-radius: 5px;
  margin: 7px 0;
  cursor: pointer;
}

.action-btn:hover {
  background: #1b7a35;
}

.hidden {
  display: none;
}

.score-header {
  background: #e8fff1;
  border-radius: 8px;
  padding: 7px 6px;
  margin-bottom: 8px;
}

.score-header .team {
  font-weight: bold;
}

.score-header .score {
  font-size: 1.29em;
  color: #18682d;
}

.score-header .rr {
  color: #666;
  font-size: 0.93em;
}

.score-header .target {
  color: #b22;
  font-size: 0.97em;
}

.partnership {
  background: #f2fbe9;
  border-radius: 8px;
  padding: 4px 7px;
  margin-bottom: 5px;
  text-align: center;
  color: #3b8143;
  font-weight: 600;
  font-size: 0.97em;
}

.extra-part {
  color: #236;
  font-size: 0.97em;
}

.runs-btns, .extras-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 5px;
}

.runs-btns button, .extras-btns button {
  flex: 1;
  min-width: 38px;
  font-size: 1.08em;
  padding: 7px 0;
  font-weight: bold;
  border-radius: 5px;
  border: none;
  background: #e6f5ed;
  color: #222;
  cursor: pointer;
  transition: background 0.15s;
}

.runs-btns button.selected, .extras-btns button.selected {
  background: #238636;
  color: #fff;
}

.ok-btn {
  background: #238636;
  color: #fff;
  font-weight: bold;
  padding: 14px 0;
  width: 100%;
  border-radius: 7px;
  margin-bottom: 7px;
  font-size: 1.14em;
  border: none;
  cursor: pointer;
}

.undo-btn {
  background: #ffe3e3;
  color: #b22;
  font-weight: bold;
  padding: 7px 0;
  width: 100%;
  border-radius: 7px;
  font-size: 1em;
  border: none;
  cursor: pointer;
}

.undo-btn:disabled {
  background: #ffe3e3;
  color: #ccc;
  cursor: not-allowed;
}

.last-balls-block {
  margin-bottom: 6px;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 5px;
  scroll-behavior: smooth;
}

.over-block {
  display: inline-block;
  background: #e3e8ef;
  color: #236;
  border-radius: 7px;
  padding: 2px 6px;
  font-size: 1.04em;
  font-weight: bold;
  margin: 0 3px 6px 0;
  min-width: 32px;
}

.over-ball-log {
  display: inline-block;
  min-width: 0;
}

.over-separator {
  display: block;
  height: 8px;
}

.editable-ball {
  cursor: pointer;
  border-bottom: 2px dotted #238636;
}

.editable-ball.selected {
  background: #c7ffd6;
}

.dismissal-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

.dismissal-btns button {
  min-width: 0;
  padding: 7px 0;
  font-size: 0.97em;
  background: #ffe3e3;
  color: #b22;
  border: 1px solid #f5c2c2;
  border-radius: 4px;
  cursor: pointer;
}

.dismissal-btns button.selected {
  background: #238636;
  color: #fff;
}

.utility-btns {
  display: flex;
  gap: 5px;
  margin-bottom: 6px;
}

.utility-btns button {
  flex: 1;
  font-size: 0.98em;
  padding: 7px 0;
  background: #e2efff;
  color: #236;
  border: 1px solid #bdd8ff;
  border-radius: 6px;
  cursor: pointer;
}

.utility-btns button:hover {
  background: #b6e5ff;
}

.batter-bowler-block {
  background: #f6f7fb;
  border-radius: 8px;
  padding: 7px 4px;
  margin-bottom: 7px;
}

.batter-bowler-block table {
  width: 100%;
  border-collapse: collapse;
}

.batter-bowler-block th, .batter-bowler-block td {
  font-size: 0.96em;
  border: none;
  padding: 2.5px 4px;
}

.batter-bowler-block th {
  color: #238636;
}

.bowler-row {
  border-bottom: 1px solid #caf7d2;
}

.bowler-row:last-child {
  border-bottom: none;
}

.edit-bar {
  background: #ffe8c4;
  border-radius: 6px;
  padding: 6px 8px;
  margin: 8px 0;
  color: #7d4a00;
  font-weight: 600;
}

.edit-bar input[type=text] {
  width: 38px;
}

.edit-bar select {
  width: 75px;
}

.edit-bar label {
  font-size: 0.96em;
}

.edit-bar .edit-btn {
  background: #238636;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 1em;
  font-weight: 600;
  margin-left: 8px;
  padding: 5px 11px;
  cursor: pointer;
}

.edit-bar .cancel-btn {
  background: #ffbcbc;
  color: #b22;
  border: none;
  border-radius: 5px;
  font-size: 1em;
  font-weight: 600;
  margin-left: 8px;
  padding: 5px 11px;
  cursor: pointer;
}

.runout-popup-bg {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: #0006;
  z-index: 1111;
  display: flex;
  justify-content: center;
  align-items: center;
}

.runout-popup {
  background: #fff;
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: 0 2px 16px #0008;
  min-width: 180px;
  text-align: center;
}

.runout-btn {
  padding: 7px 16px;
  margin: 8px 8px 0 8px;
  background: #238636;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1.06em;
  font-weight: bold;
  cursor: pointer;
}

.runout-btn.non {
  background: #e2efff;
  color: #238636;
}

.inn-swtich-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 8px;
}

.inn-swtich-btn {
  flex: 1;
  font-size: 1.06em;
  background: #e8fff1;
  color: #238636;
  border: 1px solid #caf7d2;
  border-radius: 7px;
  font-weight: bold;
  padding: 8px 0;
  cursor: pointer;
  transition: background 0.2s;
}

.inn-swtich-btn.active {
  background: #238636;
  color: #fff;
}

.inn-swtich-btn.disabled,
.inn-swtich-btn:disabled {
  background: #e8fff1;
  color: #b2b2b2;
  cursor: not-allowed;
  border: 1px solid #e8fff1;
}

.next-inn-bar {
  background: #e6eaff;
  border-radius: 7px;
  text-align: center;
  font-weight: bold;
  padding: 10px 8px;
  color: #176;
  margin: 8px 0 13px 0;
}

.action-btn-nextinn {
  background: #238636;
  color: #fff;
  padding: 7px 19px;
  border: none;
  border-radius: 5px;
  font-size: 1.04em;
  font-weight: bold;
  cursor: pointer;
  margin: 9px auto 0 auto;
  display: block;
}

.nav-bar {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100vw;
  background: #e8fff1;
  border-top: 1px solid #caf7d2;
  display: flex;
  justify-content: space-around;
  z-index: 10;
}

.nav-bar button {
  flex: 1;
  padding: 9px 0;
  border: none;
  background: none;
  font-size: 1.02em;
  color: #238636;
  font-weight: bold;
  transition: background 0.2s;
  cursor: pointer;
}

.nav-bar button.active {
  color: #fff;
  background: #238636;
  border-radius: 0;
}

.win-msg-huge {
  font-size: 2.7em;
  font-weight: bold;
  text-align: center;
  padding: 30px 0 18px 0;
  line-height: 1.18em;
  color: #125516;
  background: #e6ffe6;
  border-radius: 12px;
  margin: 18px 0 18px 0;
}

/* =========================
   Professional Header
   ========================= */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 5px 8px 5px;
  margin-bottom: 5px;
  border-bottom: 1px solid #e0e0e0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0;
}

.header-logo {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  object-fit: contain;
}

/* Hamburger Button */
.hamburger-btn {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #333;
  padding: 5px 8px;
  line-height: 1;
  z-index: 1001;
  position: relative;
}

/* =========================
   Slide Menu Styles
   ========================= */

/* Menu Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: none;
}

.menu-overlay.show {
  display: block;
}

/* Menu Panel */
.menu-panel {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100%;
  background: #fff;
  z-index: 1002;
  transition: right 0.3s ease;
  box-shadow: -2px 0 10px rgba(0,0,0,0.2);
  overflow-y: auto;
  padding: 15px;
}

.menu-panel.open {
  right: 0;
}

.menu-panel .menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #238636;
}

.menu-panel .menu-header h3 {
  color: #238636;
  margin: 0;
  font-size: 16px;
}

.menu-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #666;
  padding: 5px;
}

.menu-panel .menu-section {
  margin-bottom: 15px;
}

.menu-panel .menu-section-title {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding-left: 5px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 10px;
  margin-bottom: 3px;
  border: none;
  border-radius: 8px;
  background: #f9f9f9;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.menu-item:hover {
  background: #e8fff1;
}

.menu-item .menu-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.menu-item.backup-item {
  background: #e8fff1;
  color: #238636;
  font-weight: 600;
}

.menu-item.restore-item {
  background: #fff3e0;
  color: #e65100;
  font-weight: 600;
}

@media (max-width: 500px) {
  .container {
    padding: 2vw 2vw 60px 2vw;
  }
  .nav-bar {
    font-size: 0.99em;
  }
  .over-block {
    font-size: 0.97em;
  }
  .score-header .score {
    font-size: 1.13em;
  }
  .ok-btn {
    padding: 12px 0;
    font-size: 1.07em;
  }
  .utility-btns button, .undo-btn {
    font-size: 0.95em;
    padding: 6px 0;
  }
  .inn-swtich-btn {
    font-size: 1em;
    padding: 7px 0;
  }
  .win-msg-huge {
    font-size: 2em;
  }
}