* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; background: #0f1115; color: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }

.app { max-width: 1100px; margin: 0 auto; padding: 28px; }

.topbar {
  display: -webkit-flex;
  display: flex;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  -webkit-align-items: center;
  align-items: center;
  gap: 20px;
}
.clock { font-size: 76px; font-weight: 700; line-height: .95; letter-spacing: -3px; }
.date { margin-top: 8px; font-size: 20px; color: #b7bdc8; text-transform: capitalize; }

.weather {
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  gap: 12px;
  background: #191d24;
  border: 1px solid #2b313d;
  border-radius: 22px;
  padding: 16px 20px;
}
.weather-icon { font-size: 42px; }
.weather-temp { font-size: 28px; font-weight: 700; }
.weather-text { color: #b7bdc8; font-size: 15px; }

.hero { margin: 34px 0 22px; }
.hero h1 { margin: 0 0 6px; font-size: 30px; }
.hero p { margin: 0; color: #aab2bf; }

.grid {
  display: -webkit-grid;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card {
  min-height: 155px;
  padding: 22px;
  background: #191d24;
  border: 1px solid #2b313d;
  border-radius: 24px;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-align-items: flex-start;
  align-items: flex-start;
  box-shadow: 0 8px 26px rgba(0,0,0,.18);
  -webkit-tap-highlight-color: rgba(255,255,255,.08);
}
.card:active { transform: scale(.98); }
.card .emoji { font-size: 38px; margin-bottom: 10px; }
.card strong { font-size: 22px; }
.card small { margin-top: 5px; color: #9da7b5; font-size: 14px; }
.button-card { color: #fff; width: 100%; text-align: left; font: inherit; cursor: pointer; }

.ticker-wrap {
  margin-top: 22px;
  background: #171a20;
  border: 1px solid #2b313d;
  border-radius: 18px;
  overflow: hidden;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
}
.ticker-label { padding: 15px 16px; font-size: 12px; font-weight: 700; letter-spacing: 1px; background: #252b35; }
.ticker { padding: 15px 16px; overflow: hidden; white-space: nowrap; color: #d8dde6; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.72);
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: center; justify-content: center;
  padding: 22px; z-index: 20;
}
.hidden { display: none !important; }
.modal-card {
  width: 100%; max-width: 620px; background: #171a20;
  border: 1px solid #323947; border-radius: 28px; padding: 28px;
  position: relative; text-align: center;
}
.close { position: absolute; right: 18px; top: 12px; font-size: 34px; background: none; border: 0; color: #fff; }
.timer-display { font-size: 84px; font-weight: 700; margin: 22px 0; letter-spacing: -3px; }
.preset-row, .timer-actions { display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; gap: 10px; -webkit-justify-content: center; justify-content: center; }
.preset-row button, .timer-actions button {
  border: 0; border-radius: 14px; padding: 13px 18px; font-size: 17px; background: #2b313d; color: #fff;
}
.timer-actions { margin-top: 16px; }
.hint { color: #9da7b5; font-size: 13px; margin: 16px 0 0; }

@media (max-width: 820px) {
  .app { padding: 20px; }
  .clock { font-size: 60px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .topbar { -webkit-align-items: flex-start; align-items: flex-start; }
  .clock { font-size: 52px; }
  .weather { padding: 12px 14px; }
  .weather-icon { font-size: 34px; }
  .weather-temp { font-size: 23px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card { min-height: 135px; padding: 16px; }
  .card strong { font-size: 19px; }
  .timer-display { font-size: 64px; }
}
