/* =====================================
   Random Generator - style.css
   ===================================== */

:root{
  --bg:#f4f7fb;
  --card:#ffffff;
  --text:#222;
  --sub:#666;
  --primary:#2b7cff;
  --primary-dark:#155fd6;
  --border:#d7dce5;
  --error:#d93025;
  --result:#f8fafc;
  --shadow:0 10px 30px rgba(0,0,0,.08);
}

body.dark{
  --bg:#16181d;
  --card:#242830;
  --text:#f5f5f5;
  --sub:#b7bcc7;
  --border:#3b404b;
  --result:#1c2028;
  --shadow:0 10px 30px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Hiragino Sans","Yu Gothic UI",sans-serif;
  background:var(--bg);
  color:var(--text);
  transition:.25s;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 24px;
}

.topbar h1{margin:0;font-size:1.8rem}

#themeToggle{
  font-size:1.2rem;
  border:none;
  border-radius:12px;
  padding:10px 14px;
  cursor:pointer;
}

.container{
  max-width:1000px;
  margin:auto;
  padding:20px;
  display:grid;
  gap:24px;
}

.card{
  background:var(--card);
  border-radius:18px;
  box-shadow:var(--shadow);
  padding:24px;
}

.field{margin-bottom:20px}

label{
  display:block;
  margin-bottom:8px;
  font-weight:700;
}

input[type=number]{
  width:100%;
  padding:14px;
  border:1px solid var(--border);
  border-radius:12px;
  background:transparent;
  color:var(--text);
  font-size:1rem;
}

.segmented{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.segmented button{
  flex:1;
  min-width:120px;
  padding:12px;
  border:2px solid var(--border);
  border-radius:12px;
  background:transparent;
  color:var(--text);
  cursor:pointer;
  font-weight:700;
  transition:.2s;
}

.segmented button.selected{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
}

.actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:28px;
}

.primary,.secondary{
  flex:1;
  padding:16px;
  border:none;
  border-radius:14px;
  cursor:pointer;
  font-size:1rem;
  font-weight:700;
}

.primary{
  background:var(--primary);
  color:#fff;
}

.primary:hover{background:var(--primary-dark)}

.secondary{
  background:#8b95a7;
  color:#fff;
}

.resultHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.resultBox{
  margin-top:16px;
  min-height:220px;
  background:var(--result);
  border:2px dashed var(--border);
  border-radius:14px;
  padding:18px;
  white-space:pre-wrap;
  word-break:break-word;
}

.error{
  color:var(--error);
  font-size:.9rem;
  min-height:1.2em;
  margin-top:6px;
}

.hint{
  color:var(--sub);
  font-size:.85rem;
}

#copyButton{
  border:none;
  background:transparent;
  font-size:1.3rem;
  cursor:pointer;
}

#copyMessage{
  color:var(--primary);
  min-height:1.2em;
}

@media (max-width:700px){
  .card{padding:18px}
  .topbar h1{font-size:1.4rem}
  .actions{
    flex-direction:column;
  }
  .segmented button{
    min-width:0;
  }
}


/* PC layout update */
.layout{
 display:grid;
 grid-template-columns:420px 1fr;
 gap:24px;
 align-items:start;
}
#pcActions{
 margin-bottom:20px;
}
@media (max-width:700px){
 .layout{display:block;}
 #pcActions{
   display:flex;
   flex-direction:column;
   margin-bottom:20px;
 }
}
